source: rtems/cpukit/libcsupport/src/lchown.c

Last change on this file was 80cf60e, checked in by Sebastian Huber <sebastian.huber@…>, on 04/15/20 at 07:48:32

Canonicalize config.h include

Use the following variant which was already used by most source files:

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

  • Property mode set to 100644
File size: 840 bytes
Line 
1/*
2 *  lchown() - POSIX 1003.1b 5.6.5 - Change Owner and Group of a File
3 *             But Do Not Follow a Symlink
4 *
5 *  Written by: Vinu Rajashekhar <vinutheraj@gmail.com>
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.rtems.org/license/LICENSE.
10 */
11
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <unistd.h>
17
18#include <rtems/libio_.h>
19
20int lchown( const char *path, uid_t owner, gid_t group )
21{
22  int rv;
23  rtems_filesystem_eval_path_context_t ctx;
24  int eval_flags = RTEMS_FS_FOLLOW_HARD_LINK;
25  const rtems_filesystem_location_info_t *currentloc =
26    rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
27
28  rv = rtems_filesystem_chown( currentloc, owner, group );
29
30  rtems_filesystem_eval_path_cleanup( &ctx );
31
32  return rv;
33}
Note: See TracBrowser for help on using the repository browser.