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

4.115
Last change on this file since d2da61a was d2da61a, checked in by Sebastian Huber <sebastian.huber@…>, on 09/11/13 at 08:59:06

Filesystem: Change rtems_filesystem_chown()

Implement POSIX requirements in the high-level file system layer. Use
common implementation for all change owner variants.

  • Property mode set to 100644
File size: 1020 bytes
Line 
1/**
2 *  @file
3 *
4 *  @brief Change Owner and Group of a File
5 *  @ingroup libcsupport
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-1999.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  Modifications to support reference counting in the file system are
13 *  Copyright (c) 2012 embedded brains GmbH.
14 *
15 *  The license and distribution terms for this file may be
16 *  found in the file LICENSE in this distribution or at
17 *  http://www.rtems.com/license/LICENSE.
18 */
19
20#if HAVE_CONFIG_H
21  #include "config.h"
22#endif
23
24#include <unistd.h>
25
26#include <rtems/libio_.h>
27
28/**
29 *  POSIX 1003.1b 5.6.5 - Change Owner and Group of a File
30 */
31int chown( const char *path, uid_t owner, gid_t group )
32{
33  int rv;
34  rtems_filesystem_eval_path_context_t ctx;
35  int eval_flags = RTEMS_FS_FOLLOW_LINK;
36  const rtems_filesystem_location_info_t *currentloc =
37    rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
38
39  rv = rtems_filesystem_chown( currentloc, owner, group );
40
41  rtems_filesystem_eval_path_cleanup( &ctx );
42
43  return rv;
44}
Note: See TracBrowser for help on using the repository browser.