source: rtems/cpukit/libcsupport/src/chown.c @ 92119ed

4.11
Last change on this file since 92119ed was 92119ed, checked in by Jennifer Averett <Jennifer.Averett@…>, on Jul 1, 2010 at 3:12:38 PM

2010-07-01 Jennifer Averett <Jennifer.Averett@…>

  • libcsupport/src/chdir.c, libcsupport/src/chmod.c, libcsupport/src/chown.c, libcsupport/src/close.c, libcsupport/src/eval.c, libcsupport/src/fchdir.c, libcsupport/src/fchmod.c, libcsupport/src/fchown.c, libcsupport/src/fcntl.c, libcsupport/src/fdatasync.c, libcsupport/src/freenode.c, libcsupport/src/fstat.c, libcsupport/src/fsync.c, libcsupport/src/ftruncate.c, libcsupport/src/ioctl.c, libcsupport/src/link.c, libcsupport/src/lseek.c, libcsupport/src/mknod.c, libcsupport/src/mount.c, libcsupport/src/open.c, libcsupport/src/read.c, libcsupport/src/readlink.c, libcsupport/src/readv.c, libcsupport/src/rmdir.c, libcsupport/src/stat.c, libcsupport/src/statvfs.c, libcsupport/src/symlink.c, libcsupport/src/unlink.c, libcsupport/src/unmount.c, libcsupport/src/write.c: Removed filesystem checks for NULL methods checks from the main posix rountines. These are now required to have at a miminum default routines in the tables.
  • Property mode set to 100644
File size: 896 bytes
RevLine 
[07a3253d]1/*
2 *  chown() - POSIX 1003.1b 5.6.5 - Change Owner and Group of a File
3 *
[08311cc3]4 *  COPYRIGHT (c) 1989-1999.
[07a3253d]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
[0eae36c7]9 *  http://www.rtems.com/license/LICENSE.
[07a3253d]10 *
11 *  $Id$
12 */
13
[9c49db4]14#if HAVE_CONFIG_H
15#include "config.h"
16#endif
17
[07a3253d]18#include <sys/stat.h>
19#include <errno.h>
20
21#include <rtems.h>
22#include <rtems/libio.h>
23
[3ba74c73]24#include <rtems/libio_.h>
[a02224e]25#include <rtems/seterr.h>
[07a3253d]26
27int chown(
28  const char *path,
29  uid_t       owner,
30  gid_t       group
31)
32{
[d71fcab]33  rtems_filesystem_location_info_t   loc;
34  int                                result;
[07a3253d]35
[7baa484]36  if ( rtems_filesystem_evaluate_path( path, strlen( path ), 0x00, &loc, true ) )
[07a3253d]37    return -1;
[50f32b11]38
[9c3fa30]39  result = (*loc.ops->chown_h)( &loc, owner, group );
[d71fcab]40
[dd0f326]41  rtems_filesystem_freenode( &loc );
[50f32b11]42
[d71fcab]43  return result;
[07a3253d]44}
Note: See TracBrowser for help on using the repository browser.