/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 1989-2011 AT&T Intellectual Property *4* and is licensed under the *5* Eclipse Public License, Version 1.0 *6* by AT&T Intellectual Property *7* *8* A copy of the License is available at *9* http://www.eclipse.org/org/documents/epl-v10.html *10* (with md5 checksum b35adb5213ca9657e911e9befb180842) *11* *12* Information and Software Systems Research *13* AT&T Research *14* Florham Park NJ *15* *16* Glenn Fowler <[email protected]> *17* David Korn <[email protected]> *18* Eduardo Krell <[email protected]> *19* *20***********************************************************************/21#pragma prototyped2223#if defined(__STDPP__directive) && defined(__STDPP__hide)24__STDPP__directive pragma pp:hide chmod25#else26#define chmod ______chmod27#endif28#define _def_syscall_3d 129#define _LS_H 13031#include "3d.h"3233#undef _def_syscall_3d34#if defined(__STDPP__directive) && defined(__STDPP__hide)35__STDPP__directive pragma pp:nohide chmod36#else37#undef chmod38#endif3940#include "FEATURE/syscall"4142int43chmod3d(const char* path, mode_t mode)44{45register char* sp;46register int r;4748#if FS49register Mount_t* mp;5051if (!fscall(NiL, MSG_chmod, 0, path, mode))52return(state.ret);53mp = monitored();54#endif55if (!(sp = pathreal(path, state.safe ? (P_SAFE|P_TOP) : P_TOP, NiL)))56return(-1);57r = CHMOD(sp, mode);58#if FS59if (!r)60{61if (mp)62fscall(mp, MSG_chmod, 0, state.path.name, mode);63for (mp = state.global; mp; mp = mp->global)64if (fssys(mp, MSG_chmod))65fscall(mp, MSG_chmod, 0, state.path.name, mode);66}67#endif68return(r);69}707172