pike.git / src / modules / _Stdio / efuns.c

version» Context lines:

pike.git/src/modules/_Stdio/efuns.c:1944:    *! @seealso    *! @[Stdio.File->errno()], @[strerror()]    */   static void f_errno(INT32 args)   {    pop_n_elems(args);    push_int(errno);   }       + #if defined(HAVE_ACCESS)   /*! @decl int access( string path, string|void mode )    *!    *! access() checks it the calling process can access the file    *! @[path]. Symbolic links are dereferenced.    *!    *! The @[mode] specifies the accessibility checks to be performed, and    *! is either not specified or empty, in which case access() just tests if the    *! file exists, or one or more of the characters "rwx".    *!    *! r, w, and x test whether the file exists and grants read, write,
pike.git/src/modules/_Stdio/efuns.c:1988:    *! ENOTDIR: One of the directories used in @[path] is not, in fact, a directory    *!    *! EROFS: The filesystem is read only and write access was requested    *!    *! Other errors can occur, but are not directly related to the    *! requested path, such as ENOMEM etc.    *!    *! @seealso    *! @[errno()]    */ - static void f_file_access( INT32 args ) + static void f_access( INT32 args )   {    const char *path;    int flags, res;    if( args == 2 )    {    char *how;    int i;    get_all_args( "access", args, "%s%s", &path, &how );    flags = 0;    for( i=0; how[i]; i++ )
pike.git/src/modules/_Stdio/efuns.c:2025:       THREADS_ALLOW_UID();    do {    res = access( path, flags );    } while( (res == -1) && (errno == EINTR) )    THREADS_DISALLOW_UID();       pop_n_elems(args);    push_int( !res );   } + #endif      void init_stdio_efuns(void)   {    set_close_on_exec(0,1);    set_close_on_exec(1,1);    set_close_on_exec(2,1);      #if 0   #ifdef HAVE_LIBZFS_INIT    libzfs_handle = libzfs_init();
pike.git/src/modules/_Stdio/efuns.c:2066: Inside #if defined(__NT__)
   }    }   #endif      /* function(string,int|void:object) */    ADD_EFUN("file_stat",f_file_stat,tFunc(tStr tOr(tInt,tVoid),tObjIs_STDIO_STAT), OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);       /* function(string,int:int(0..1)) */    ADD_EFUN("file_truncate",f_file_truncate,tFunc(tStr tInt,tInt),OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);   #if defined(HAVE_ACCESS) -  ADD_EFUN("access", f_file_access, tFunc(tStr tOr(tVoid,tStr),tInt),OPT_EXTERNAL_DEPEND); +  ADD_EFUN("access", f_access, tFunc(tStr tOr(tVoid,tStr),tInt),OPT_EXTERNAL_DEPEND);   #endif   #if defined(HAVE_FSETXATTR) && defined(HAVE_FGETXATTR) && defined(HAVE_FLISTXATTR)    ADD_EFUN( "listxattr", f_listxattr, tFunc(tStr tOr(tVoid,tInt),tArr(tStr)), OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);    ADD_EFUN( "setxattr", f_setxattr, tFunc(tStr tStr tStr tInt tOr(tVoid,tInt),tInt), OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);    ADD_EFUN( "getxattr", f_getxattr, tFunc(tStr tStr tOr(tVoid,tInt),tStr), OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);    ADD_EFUN( "removexattr", f_removexattr, tFunc(tStr tStr tOr(tVoid,tInt),tInt), OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);   #endif      #if defined(HAVE_STATVFS) || defined(HAVE_STATFS) || defined(HAVE_USTAT) || defined(__NT__)