4.115
Last change
on this file since c499856 was
c499856,
checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47
|
Change all references of rtems.com to rtems.org.
|
-
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.org/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 | */ |
---|
31 | int 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.