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

4.104.114.84.95
Last change on this file since d71fcab was d71fcab, checked in by Joel Sherrill <joel.sherrill@…>, on 10/12/99 at 18:44:40

Added call to freenod to let each filesystem free its own internal
node used to manage file access.

  • Property mode set to 100644
File size: 1022 bytes
RevLine 
[07a3253d]1/*
2 *  chown() - POSIX 1003.1b 5.6.5 - Change Owner and Group of a File
3 *
4 *  COPYRIGHT (c) 1989-1998.
5 *  On-Line Applications Research Corporation (OAR).
6 *  Copyright assigned to U.S. Government, 1994.
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.OARcorp.com/rtems/license.html.
11 *
12 *  $Id$
13 */
14
15#include <sys/stat.h>
16#include <errno.h>
17
18#include <rtems.h>
19#include <rtems/libio.h>
20
21#include "libio_.h"
22
23int chown(
24  const char *path,
25  uid_t       owner,
26  gid_t       group
27)
28{
[d71fcab]29  rtems_filesystem_location_info_t   loc;
30  int                                result;
[07a3253d]31
[d71fcab]32  if ( rtems_filesystem_evaluate_path( path, 0x00, &loc, TRUE ) )
[07a3253d]33    return -1;
34 
[d71fcab]35  if ( !loc.ops->chown ) {
36    if ( loc.ops->freenod )
37      (*loc.ops->freenod)( &loc );
[07a3253d]38    set_errno_and_return_minus_one( ENOTSUP );
[d71fcab]39  }
[07a3253d]40
[d71fcab]41  result = (*loc.ops->chown)( &loc, owner, group );
42
43  if ( loc.ops->freenod )
44    (*loc.ops->freenod)( &loc );
45 
46  return result;
[07a3253d]47}
Note: See TracBrowser for help on using the repository browser.