aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
Commit message (Collapse)AuthorAgeFilesLines
...
* wrapper object before allocnobu2015-05-161-1/+3
| | | | | | | | | | * error.c (rb_name_err_mesg_new): new wrapper object before allocate data area and get rid of potential memory leak. GC guards are no longer needed. * file.c (stat_new_0): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_f_test): Consider nsec for "=", "<" and ">" for "test"akr2015-04-111-3/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: move rb_readlink on Windowsnobu2015-03-231-0/+2
| | | | | | | * win32/file.c (rb_readlink): move from file.c for better buffer allocation and the result encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32.c: w32_lstati64nobu2015-03-231-1/+1
| | | | | | | | * win32/win32.c (winnt_stat): stat with following symbolic links. * win32/win32.c (winnt_lstat): rename old winnt_stat, which does not follow symbolic links. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: fix handle leaknobu2015-02-201-2/+28
| | | | | | | * file.c (rb_file_identical_p): fix handle leak, ensure to close the handle of the first argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: replace with real pathnobu2015-01-241-2/+2
| | | | | | | | | * ruby.c (dladdr_path): replace the executable path with symlinked real path. dladdr(3) on Linux returns the argv[0] as dli_fname instead of the real path, for a symbol defined in the executable file itself. [Bug #10776] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c: Document other cases of missing birthtime on OS with patchzzak2015-01-211-4/+5
| | | | | | provided by @sho-h similar to GH-817. [ci skip] [DOC] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c: NotImplementedError is raised if birthtime is unavailable.zzak2015-01-191-1/+1
| | | | | | | | Patch by @y-yagi san and [Fixes GH-817] [ci skip] [DOC] * ext/pathname/pathname.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: drop ignored charsnobu2014-12-251-10/+68
| | | | | | | * file.c (rb_file_expand_path_internal): drop characters ignored by filesystem on Mac OS X. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use 0 for reservednobu2014-12-011-1/+1
| | | | | | | use 0 for rb_data_type_t::reserved instead of NULL, since its type may be changed in the future and possibly not a pointer type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: unnecessary #undefnobu2014-11-281-1/+0
| | | | | | | * file.c (flock): remove unnecessary #undef flock, trace of green thread polling. patched by Rohan Garg. [Bug #10551] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: Include ruby.h and ruby/encoding.h to beakr2014-11-151-2/+1
| | | | | | | | includable without prior inclusion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Enable nacl_io in pepper-ruby.yugui2014-10-211-3/+0
| | | | | | | | | | | | | | | | | | | | | * configure.in (XCFLAGS): Add include path for NaCl libraries. (XLDFLAGS): ditto. (NACL_LIB_PATH): new stubstitution * nacl/nacl-config.rb: support NACL_LIB_PATH * nacl/package.rb: ditto. * nacl/pepper_main.c: replace old implementations with nacl_io. * nacl/GNUmakefile.in: link nacl_io to pepper_ruby * ruby.c (rb_load_file): remove __attribute__((weak)) because the old override hack was replaced with nacl_io. * file.c (rb_file_load_ok): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c: include sys/time.h only if HAVE_SYS_TIME_Hyugui2014-10-111-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: fix compile error on Linuxnobu2014-10-111-1/+1
| | | | | | | * file.c (sys/time.h): include after unistd.h to get rid of mismatch on struct stat and some system call functions on Linux. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2014-10-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (HAVE_UTIMENSAT): disabled for NativeClient.yugui2014-10-111-5/+9
| | | | | | Fixes build error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fixes build failures on Portable Native Client.yugui2014-10-111-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note: Some of the fixes are for newlib in general but not NaCl-specific. * include/ruby/intern.h (rb_fd_select): declare struct timeval, or the struct gets local to the function in C99. * file.c (#include): add nacl/stat.h for PNaCl. (utimes): added a declaration for PNaCl. (stat_atimespec): stat::st_atimensec is long long but timespec::tv_nsec is long in PNaCl. (stat_mtimespec, stat_ctimespec): ditto. (rb_group_member): disable getgroups unless HAVE_GETGROUPS. (eaccess): unify the fallback to generic defined(USE_GETEUID). * io.c: include sys/time.h for struct timeval. (rb_close_before_exec): nothing we can do if F_GETFD is not available. (ioctl): pnacl newlib actually doesn't have ioctl. * process.c (maxgroups): it is used iff defined(_SC_NGROUPS_MAX) || defined(NGROUPS_MAX) but not defined(HAVE_GETGROUPS) || defined(HAVE_SETGROUPS). (obj2gid): fail unless the object is a Fixnum if getgrnam is not available. (disable_child_handler_fork_child): sigaction is not available in PNaCl newlib. * configure.in (warnflags, strict_warnflags): avoid -ansi for strlcpy. (rb_cv_gcc_atomic_builtins): also check __atomic_or_etch because it is used in ruby_atomic.h. (rb_cv_gcc_sync_builtins): ditto. (HAVE_GETGRNAM): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merges a patch form naclports.yugui2014-10-111-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | * configure.in (RUBY_NACL and others): Supports PNaCl. * dln.c: replace the old hacky dynamic loading over HTTP with nacl_io. * file.c: tenatively use access(2) instead of eaccess. (rb_file_load_ok): weaken with attribute but not by postprocess. * io.c (socket.h): now NaCl has socket.h (flock): disable here instead of nacl/ioctl.h * nacl/GNUmakefile.in (CC, LD, NM, AR, AS, RANLIB, OBJDUMP, OBJCOPY): respect path to them if they are absolute. This helps naclports to build ruby in their source tree. (PROGRAM_NMF, .SUFFIXES): support .pnexe for PNaCl. (ruby.o, file.o): move the hack to attributes in ruby.c and file.c * nacl/ioctl.h: removed. move the hack to io.c. * nacl/nacl-config.rb: support arm, pnacl and others. * nacl/pepper_main.c: support build in a naclports tree. * ruby.c (rb_load_file): weaken with attribute but not by postprocess. The patch is by sbc@google.com and the Native Client Authors. It is available at: * https://chromium.googlesource.com/external/naclports.git/+/873ca4910a5f9d4206306aacb4ed79c587c6a5f3/ports/ruby/nacl.patch git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: clear tmp buffer on failuresnormal2014-09-211-0/+2
| | | | | | | | | | | Reduces GC malloc pressure (MAXPATHLEN is 4096 on my system), rb_find_file_safe hits this path at least twice every time ruby starts. * file.c (rb_find_file_ext_safe): clear tmp buffer on failure (rb_find_file_safe): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add some documents [ci skip]nobu2014-07-281-1/+6
| | | | | | | | | | | | | | | * bignum.c (Init_Bignum): [DOC] Bignum::GMP_VERSION. * complex.c (Init_Complex): [DOC] ignore an internal class. * dir.c (Init_Dir): [DOC] File::FNM_SYSCASE. * file.c (rb_file_exists_p): [DOC] File.exists? is deprecated. * object.c (rb_mod_initialize_clone): [DOC] ignore implementation detail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c: [DOC] Clarify how File.file? handles symbolic links. Alsozzak2014-07-271-4/+6
| | | | | | | | cleaned up the rdoc style for this method, more to follow. Originally reported by Michael Renner [Bug #10067] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c, ext/pathname/pathname.c: [DOC] correct position of method rdoc.ktsj2014-07-061-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c: [DOC] document File.join returns a string.hsbt2014-06-301-1/+1
| | | | | | Contributed by @dapplebeforedawn. [fix GH-646] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* constify parametersnobu2014-06-181-2/+2
| | | | | | | | * include/ruby/intern.h: constify `argv` parameters. * include/ruby/ruby.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: shrink expanded pathnobu2014-06-121-3/+14
| | | | | | | * file.c (expand_path): shrink expanded path which no longer needs rooms to append. [ruby-core:63114] [Bug #9934] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* encoding.h: constify rb_encodingnobu2014-06-021-9/+9
| | | | | | | * include/ruby/encoding.h: constify `rb_encoding` itself, not only arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* constify rb_encoding and OnigEncodingnobu2014-06-011-9/+9
| | | | | | | * include/ruby/encoding.h: constify `rb_encoding` arguments. * include/ruby/oniguruma.h: constify `OnigEncoding` arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: birthtime on Windowsnobu2014-05-221-0/+1
| | | | | | * file.c (stat_birthtime): `ctime` is actually `created time` on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (stat_birthtime): add birthtime support [Feature #9647]naruse2014-05-221-1/+111
| | | | | | | | | | | | * file.c (rb_stat_birthtime): add File::Stat.birthtime * file.c (rb_file_s_birthtime): add File.birthtime * file.c (rb_file_birthtime): add File#birthtime * configure.in: check struct stat.st_birthtimespec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert File::Statfs [Feature #9772]naruse2014-05-221-385/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_f_test): removed meaningless "case 'a'".tadf2014-05-051-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (HAVE_STRUCT_STATVFS_F_BASETYPE): File::Statfs#fstypenamengoto2014-05-021-1/+4
| | | | | | | | | | is supported on AIX, HP-UX, and Solaris, by using the value of struct statvfs.f_basetype. * configure.in (HAVE_STRUCT_STATVFS_F_BASETYPE): check struct statvfs.f_basetype which is available on AIX, HP-UX, and Solaris. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add indentkazu2014-05-011-14/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c: Change AND condition to nested condition.kazu2014-05-011-5/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (FSTATFS): check availability of struct statfs andngoto2014-04-301-2/+2
| | | | | | | | struct statvfs in addition to fstatfs(2) and fstatvfs(2). This fixes error in Solaris. [Bug #9788] [ruby-dev:48145] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* new macros for statfs_tkazu2014-04-281-8/+20
| | | | | | | | | | | | | | | * file.c (HAVE_STRUCT_STATFS_T_F_FSTYPENAME): Add new macro for statfs_t. * file.c (HAVE_STRUCT_STATFS_T_F_TYPE): ditto. * file.c (rb_io_statfs): check FSTATFS macro only instead of HAVE_FSTATFS and HAVE_FSTATVFS. * file.c (statfs_type): use new macro. * file.c (statfs_fstypename): ditto. * file.c (statfs_inspect): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix preprocessor conditionkazu2014-04-281-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: fix typonobu2014-04-281-2/+2
| | | | | | * file.c (FSTATFS): fix typo and commit miss. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: fix errors on Windowsnobu2014-04-281-14/+18
| | | | | | | * file.c (rb_io_statfs, rb_statfs_init, statfs_inspect): fix compilation errors on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (HAVE_STRUCT_STATFS_F_TYPE): check struct statfs.f_typenaruse2014-04-281-2/+2
| | | | | | | | | | to support OpenBSD. * file.c (statfs_type): use above macro to switch. * file.c (statfs_inspect): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: check struct statvfs and struct statvfs.f_fstypename.naruse2014-04-281-27/+49
| | | | | | | | * configure.in: on NetBSD fstatfs is obsoleted. * file.c: support NetBSD for File::Statfs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (statfs_inspect): suppress warnings.naruse2014-04-241-4/+4
| | | | | | assume those values won't be larger than LONG_LONG_MAX. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: statfs_inspectnobu2014-04-241-0/+38
| | | | | | * file.c (statfs_inspect): add File::Statfs#inspect method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (statfs_fsid): remove statfs.f_fsid because it doesn't returnnaruse2014-04-231-17/+0
| | | | | | meaningful value portably. http://togetter.com/li/658517 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: unpack in binarynobu2014-04-231-10/+3
| | | | | | | | * file.c (statfs_fsid): convert with rb_integer_unpack. * configure.in: fsid_t is no longer used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: fsid_t may not be definednobu2014-04-231-0/+4
| | | | | | | | | * configure.in: check if fsid_t is defined. * file.c (statfs_fsid): fsid_t may not be defined, assume long in that case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * win32/win32.c, include/ruby/win32.h (ustatfs): implementation ofusa2014-04-221-1/+7
| | | | | | | | | | | statfs(2) clone. [EXPERIMENTAL] * file.c (rb_io_statfs): use above function. * configure.in, win32/Makefile.sub (struct statfs): available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_io_stafs): use statfs(2) if fstatfs(2) is unavailable.usa2014-04-221-1/+6
| | | | | | | * configure.in (fstatfs): check it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: suppress a warningnobu2014-04-221-2/+6
| | | | | | | * file.c (statfs_fsid): use union to suppress strict-aliasing warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e