source: rtems/cpukit/libcsupport/src/chown.c @ b72e368c

4.104.114.84.9
Last change on this file since b72e368c was 9c49db4, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 8, 2001 at 6:26:44 PM

2001-01-08 Ralf Corsepius <corsepiu@…>

  • configure.in: Add libc/config.h
  • libc/Makefile.am: Add INCLUDES += -I. to pickup config.h
  • libc/.cvsignore: Add config.h and stamp-h
  • libc/*.c: Add config.h support.
  • Property mode set to 100644
File size: 983 bytes
Line 
1/*
2 *  chown() - POSIX 1003.1b 5.6.5 - Change Owner and Group of a File
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 *  $Id$
12 */
13
14#if HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#include <sys/stat.h>
19#include <errno.h>
20
21#include <rtems.h>
22#include <rtems/libio.h>
23
24#include <rtems/libio_.h>
25
26int chown(
27  const char *path,
28  uid_t       owner,
29  gid_t       group
30)
31{
32  rtems_filesystem_location_info_t   loc;
33  int                                result;
34
35  if ( rtems_filesystem_evaluate_path( path, 0x00, &loc, TRUE ) )
36    return -1;
37 
38  if ( !loc.ops->chown_h ) {
39    rtems_filesystem_freenode( &loc );
40    set_errno_and_return_minus_one( ENOTSUP );
41  }
42
43  result = (*loc.ops->chown_h)( &loc, owner, group );
44
45  rtems_filesystem_freenode( &loc );
46 
47  return result;
48}
Note: See TracBrowser for help on using the repository browser.