OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [libcsupport/] [src/] [fchmod.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
2
 *  fchmod() - POSIX 1003.1b 5.6.4 - Change File Modes
3
 *
4
 *  COPYRIGHT (c) 1989-1999.
5
 *  On-Line Applications Research Corporation (OAR).
6
 *
7
 *  The license and distribution terms for this file may be
8
 *  found in the file LICENSE in this distribution or at
9
 *  http://www.OARcorp.com/rtems/license.html.
10
 *
11
 *  fchmod.c,v 1.9 2002/01/04 18:29:36 joel Exp
12
 */
13
 
14
#if HAVE_CONFIG_H
15
#include "config.h"
16
#endif
17
 
18
#include <unistd.h>
19
#include <sys/stat.h>
20
#include <errno.h>
21
 
22
#include <rtems.h>
23
#include <rtems/libio.h>
24
#include <rtems/libio_.h>
25
#include <rtems/seterr.h>
26
 
27
int fchmod(
28
  int       fd,
29
  mode_t    mode
30
)
31
{
32
  rtems_libio_t *iop;
33
 
34
  rtems_libio_check_fd( fd );
35
  iop = rtems_libio_iop( fd );
36
  rtems_libio_check_is_open(iop);
37
 
38
  /*
39
   *  Now process the fchmod().
40
   */
41
 
42
  rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
43
 
44
  if ( !iop->handlers->fchmod_h )
45
    rtems_set_errno_and_return_minus_one( ENOTSUP );
46
 
47
  return (*iop->pathinfo.handlers->fchmod_h)( &iop->pathinfo, mode );
48
}
49
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.