From 49588c9c79819fe838fce29a44d33d330308ca59 Mon Sep 17 00:00:00 2001 From: sszymczy Date: Tue, 26 Aug 2008 11:21:10 +0000 Subject: [PATCH] Added missing path conversion and some documentation. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@29260 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- compiler/clib/chmod.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/compiler/clib/chmod.c b/compiler/clib/chmod.c index b64b2ab205..89b15851e2 100644 --- a/compiler/clib/chmod.c +++ b/compiler/clib/chmod.c @@ -7,14 +7,57 @@ #include #include -#include +#include #include "__errno.h" +#include "__upath.h" ULONG prot_u2a(mode_t protect); -int chmod(const char *path, mode_t mode) +/***************************************************************************** + + NAME */ +#include + + int chmod( + +/* SYNOPSIS */ + const char *path, + mode_t mode) + +/* FUNCTION + Change permission bits of a specified file. + + INPUTS + path - path to the file + mode - permission bits + + RESULT + Permission bits of the file given by path are changed accordingly + to given mode. + + NOTES + + EXAMPLE + + BUGS + + SEE ALSO + + INTERNALS + +******************************************************************************/ { + if (!path) /*safety check */ + { + errno = EFAULT; + return -1; + } + + path = __path_u2a(path); + if (path == NULL) + return -1; + if (!SetProtection(path, prot_u2a(mode))) { errno = IoErr2errno(IoErr()); -- 2.11.4.GIT