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

version» Context lines:

pike.git/src/modules/_Stdio/file.c:2919: Inside #if defined(HAVE_FSYNC)
      if (ret < 0) {    ERRNO = errno = e;    push_int(0);    } else {    push_int(1);    }   }   #endif /* HAVE_FSYNC */    - #if defined(INT64) && (defined(HAVE_LSEEK64) || defined(__NT__)) + #if (defined(HAVE_LSEEK64) || defined(__NT__))   #define SEEK64   #endif         /*! @decl int seek(int offset)    *! @decl int seek(int offset, string whence)    *!    *! The seek() function repositions the offset of the open file    *! associated with the file descriptor fd to the argument @[offset]    *! according to the directive @[whence] as follows:
pike.git/src/modules/_Stdio/file.c:3085:    to = lseek64(FD,to,how);   #else    to = fd_lseek(FD,to,how);   #endif    if(to<0) ERRNO=errno;       pop_n_elems(args);    push_int64(to);   }    - #if defined(INT64) && (defined(HAVE_LSEEK64) || defined(__NT__)) + #if (defined(HAVE_LSEEK64) || defined(__NT__))   #define TELL64   #endif      /*! @decl int tell()    *!    *! Returns the current offset in the file.    *!    *! @seealso    *! @[seek()]    */
pike.git/src/modules/_Stdio/file.c:3135:    *! Truncates the file to the specified length @[length].    *!    *! @returns    *! Returns @expr{1@} on success, and @expr{0@} (zero) on failure.    *!    *! @seealso    *! @[open()]    */   static void file_truncate(INT32 args)   { - #if defined(INT64) +     INT64 len = 0; - #else -  off_t len = 0; - #endif +     int res;       if(args!=1)    SIMPLE_WRONG_NUM_ARGS_ERROR("truncate", 1);    - #if defined (INT64) +    #if defined (HAVE_FTRUNCATE64) || SIZEOF_OFF_T > SIZEOF_INT_TYPE    if(is_bignum_object_in_svalue(&Pike_sp[-args])) {    if (!int64_from_bignum(&len, Pike_sp[-args].u.object))    Pike_error ("Bad argument 1 to Stdio.File->truncate(). Length too large.\n");    }    else   #endif - #endif +     if(TYPEOF(Pike_sp[-args]) != PIKE_T_INT)    SIMPLE_ARG_TYPE_ERROR("truncate", 1, "int");    else    len = Pike_sp[-args].u.integer;       if(FD < 0)    Pike_error("File not open.\n");       ERRNO=0;   #ifdef HAVE_FTRUNCATE64