2 Copyright © 1995-2002, The AROS Development Team. All rights reserved.
5 ANSI C function fchmod().
10 #include <aros/debug.h>
11 #include <proto/exec.h>
12 #include <proto/dos.h>
13 #include <sys/types.h>
21 ULONG
prot_u2a(mode_t protect
);
23 /*****************************************************************************
26 #include <sys/types.h>
36 Change permission bits of a file specified by an open file descriptor.
39 filedes - File descriptor of the file
40 mode - Permission bits to set
43 0 on success and -1 on error. If an error occurred, the global
44 variable errno is set.
47 See chmod() documentation for more details about the mode parameter.
58 ******************************************************************************/
64 if (!(fdesc
= __getfdesc(filedes
)))
70 /* Get the full path of the stated filesystem object and use it to
74 if(!(buffer
= AllocVec(buffersize
, MEMF_ANY
)))
76 errno
= IoErr2errno(IoErr());
80 if(NameFromLock(fdesc
->fcb
->fh
, buffer
, buffersize
))
82 else if(IoErr() != ERROR_LINE_TOO_LONG
)
84 errno
= IoErr2errno(IoErr());
93 if (!SetProtection(buffer
, prot_u2a(mode
)))
96 errno
= IoErr2errno(IoErr());