1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-20 23:20:36 -08:00
Commit graph

68 commits

Author SHA1 Message Date
Stefan Monnier
c0ec53ad99 Update calls to openp. 2001-10-12 03:37:43 +00:00
Gerd Moellmann
32c82ac0a1 Don't define min/max. 2001-10-08 08:08:08 +00:00
Gerd Moellmann
302f0b2912 (sys_open): Try to open file without _O_CREAT first, to be
able to write to hidden and system files.  Make file handles
non-inheritable.
2001-04-10 12:15:25 +00:00
Jason Rumney
aca583b261 (init-environment): Duplicate local string before putenv. 2001-02-09 09:57:04 +00:00
Andrew Innes
cc14250a79 (init_environment): Add a version-independent site-lisp
directory to EMACSLOADPATH, after the version dependent one.
2001-01-19 14:56:06 +00:00
Jason Rumney
253574a62d (init_environment, sys_shutdown, sys_pipe): Remove unused
variables.
2001-01-13 00:00:26 +00:00
Andrew Innes
18e070ac54 (w32_strerror): New function. 2000-12-18 23:50:26 +00:00
Andrew Innes
cfb5e8555e (sys_rename): Only check errno against EEXIST, and not
EACCES, when determining whether rename failed because the target
exists.  This was resulting in indefinite looping on Windows 9x if
the source file was locked by another process.
2000-12-17 23:14:55 +00:00
Jason Rumney
69fb0241f4 (init_environment): Set LANG environment variable based on
locale settings, if not set.
2000-11-24 21:30:06 +00:00
Andrew Innes
971bce757c (_ANONYMOUS_UNION) [__GNUC__]: New define
(_ANONYMOUS_STRUCT) [__GNUC__]: New define.
2000-09-03 17:41:20 +00:00
Andrew Innes
a302c7ae2b (GetCachedVolumeInformation): Use xmalloc, xfree and xstrdup.
(add_volume_info): Use xstrdup.
(init_environment): Call _access.
(check_windows_init_file): Call _close.
(init_user_info): Call _putenv.
(init_environment): Call _putenv and _strdup.
(init_ntproc): Reset volume info cache on startup.
(unc_volume_file_attributes):
(open_unc_volume): Make arg const.
(gettimeofday): Use struct timeb, not struct _timeb.
(map_w32_filename, read_unc_volume): Fix compile warning.
(sys_strerror): Use sys_nerr instead of _sys_nerr.  Use
sys_errlist instead of _sys_errlist.
(get_emacs_configuration_options): New function.
2000-08-22 22:49:27 +00:00
Andrew Innes
ca149beb3f (init_environment): Install code from 20.7 for providing
default values for environment variables, based on the
executable's own location.
(map_w32_filename): Handle filenames that are longer than
MAX_PATH.
(sys_socket): Install socket inheritance bug fix from 20.7.
2000-07-05 16:00:13 +00:00
Gerd Moellmann
9ab8560dc2 Use the term invalid' instead of illegal'. 2000-05-16 14:29:08 +00:00
Jason Rumney
20af483168 (init_environment): Set Vw32_num_mouse_buttons here. 2000-02-27 21:28:38 +00:00
Andrew Innes
8f900f6e16 (sigmask): New function (does nothing).
(sigunblock): Ditto.
2000-02-06 23:37:46 +00:00
Geoff Voelker
b19cc00c30 (stat): Check for directory ending in separator when
doing readdir fast path.
1999-08-06 20:40:36 +00:00
Geoff Voelker
c5247da267 (get_emacs_configuration): Use GetVersionEx to
handle NT5.0 correctly.  Include build number in configuration.
w32heap.c (osinfo_cache): New variable.
1999-06-24 22:05:14 +00:00
Andrew Innes
d8fcc1b984 (sys_strerror): New function. 1999-06-16 20:00:19 +00:00
Andrew Innes
aa7b87b0b2 (init_environment): Change argv[0] to contain the full path to Emacs. 1999-01-30 18:48:57 +00:00
Geoff Voelker
4f8ac0b2d6 (w32_get_long_filename): Handle root dirs correctly. 1998-12-10 05:43:07 +00:00
Geoff Voelker
a0b9c8385f (check_windows_init_file): Use decode_env_path when
using EMACSLOADPATH.
1998-12-03 03:14:46 +00:00
Andrew Innes
01f31dfb5f (stat): GetFileInformationByHandle can legitimately fail, so don't
rely on it succeeding.
1998-11-03 22:39:04 +00:00
Geoff Voelker
96ef7d42fb (check_windows_init_file): Also look in load path specified
in environment.
1998-10-27 23:42:26 +00:00
Geoff Voelker
d54abccd47 (init_ntproc): Check for Windows init file.
(term_ntproc): Do not check for it here.
1998-10-07 19:47:48 +00:00
Richard M. Stallman
710ea1b88d (stat): Fall-back to default behaviour when we cannot get
accurate information on file attributes.
1998-08-14 03:47:10 +00:00
Geoff Voelker
9d3355d178 (is_unc_volume, open_unc_volume, read_unc_volume,
close_unc_volume, unc_volume_file_attributes): New functions.
(wnet_enum_handle): New variable.
(opendir, readdir, closedir, sys_access, stat): Handle UNC volumes.
1998-06-17 04:22:58 +00:00
Richard M. Stallman
f313ee82af (sys_rename): On some network drives, rename fails with
EACCES instead of EEXIST if target already exists.
1998-06-16 04:33:08 +00:00
Richard M. Stallman
58f0cb7e31 (sys_rename): Don't examine errno if rename didn't fail. 1998-06-10 21:00:39 +00:00
Karl Heuer
b3308d2eb9 #include sys/file.h
(sys_access): Provide our own implementation which recognizes D_OK.
(is_exec): New function.
(stat): Use it.
(init_environment): Set TMPDIR to an existing directory.
Abort if none of the usual places is available.
(sys_rename): On Windows 95, choose a temp name that
includes the original file's base name and use an explicit loop
rather than calling mktemp.  Only attempt to unlink the newname if
the rename fails, rather than second-guessing whether the old and
new names refer to the same file.
1998-06-05 16:08:32 +00:00
Geoff Voelker
eb9ea53f9c (sys_rename): Handle filenames with accented characters.
(stat): Handle "c:/.." and "/.." specially.
1998-05-30 23:41:57 +00:00
Richard M. Stallman
bb1584c878 (stat, get_long_basename): Fail if filename contains any
characters that are illegal in file names.
1998-05-12 21:33:44 +00:00
Geoff Voelker
caf1a17212 (sys_socket): Make sockets non-inheritable. 1998-04-24 04:35:05 +00:00
Geoff Voelker
16bb7578f2 (fstat, utime): New functions; these are provided in
conjunction with stat to make handling of file timestamps
consistent.
(convert_from_time_t): Fix calculation of low-order bits.
(sys_unlink): Allow read-only files to be unlinked as on Unix.
1998-04-23 23:41:12 +00:00
Geoff Voelker
f52eb3efc4 (sys_read): Clear carriage return flag.
Report normal EOF when read fails if nothing in buffer.
Only read more if more remaining.
(check_windows_init_file): New function.
(term_ntproc): Invoke check_windows_init_file.
1998-04-17 05:07:15 +00:00
Eli Zaretskii
7664e30672 (sys_pipe): Use binary pipe I/O unconditionally. 1998-04-15 14:40:43 +00:00
Karl Heuer
03887dd388 (min, max): Define as macros. 1998-04-09 18:12:46 +00:00
Karl Heuer
c66245847e (unrequest_sigio, request_sigio): Fix prototype. 1998-04-09 17:06:31 +00:00
Geoff Voelker
76b3903d85 Include stddef.h.
(getwd): Delete macro.
(startup_dir): New variable.
(getwd): Return directory in which Emacs started.
(init_user_info): Set SHELL environment variable if not set.
(parse_root, get_long_basename, w32_get_long_filename): New functions.
(init_environment): Look for CMDPROXY.
Make sure that PATH and COMSPEC are capitalized in the environment.
Record startup directory.
(get_emacs_configuration, sys_rename): Use OS_WIN95.
(map_w32_filename): Calculate returned string correctly.

(sys_fopen): Use _fdopen.
(sys_link): Support NTFS links.
(sys_rename): Use a long file name for temporary name.
(sys_pipe): Make pipes binary and non-inheritable.
(sys_read, sys_write): Spoof text mode translation for pipes
and sockets.

(hashval): Simplify.
(generate_inode_val): Use long file name version of file.

(stat): Optimize by using active readdir info.
Set fake_inode to 0 for directories.
Set fake_inode to xor of file indexes for files.
Don't use generate_inode_val to set inode value.

(volume_info_data): Renamed from volume_info.
(volume_info, fixed_drives, volume_cache): New variables.
(DRIVE_INDEX, VOLINFO_STILL_VALID): New macros.
(lookup_volume_info, add_volume_info, GetCachedVolumeInformation):
New functions.
(get_volume_info): Use volume_info_data.
Use GetCachedVolumeInformation.

(init_ntproc): No longer restrict to one DOS subprocess.
Use CRT _open and _fdopen.
Cache fixed drive information.
1997-09-03 00:43:20 +00:00
Geoff Voelker
380961a672 (sys_shutdown): New function. 1997-07-10 20:10:09 +00:00
Geoff Voelker
75b08edbf5 Rebuild Vsystem_configuration at startup. 1997-01-20 01:52:48 +00:00
Geoff Voelker
e9e23e2348 Change all uses of win95, winnt, and win32
into Windows 95, Windows NT, and W32, respectively.
Expand "win" substring in variables referring to Microsoft Windows
constructs into "windows".
Canonicalize header comments to use same terminology.
1997-01-20 00:38:22 +00:00
Richard M. Stallman
1f8bd7fb36 (get_emacs_configuration): Return windows95 instead of win95. 1997-01-15 20:19:54 +00:00
Geoff Voelker
489f937121 Use new names for w32 files 1996-11-19 07:04:49 +00:00
Geoff Voelker
fbd6baedb5 Change identifiers of the form win32* to w32*. 1996-11-19 04:59:23 +00:00
Miles Bader
5162ffce81 (normalize_filename): Always lower-case drive letters, even on systems
that preserve case in filenames.
(sys_rename): Do not delete newname if only changing case.  On Windows
	95, use our version of mktemp (not the MSVC version) and give
	the temp name a long extension to ensure the final rename works
	as expected.
1996-07-07 01:59:24 +00:00
Richard M. Stallman
6b5edcadd1 Delete restrict_dos_process. 1996-06-12 18:19:40 +00:00
Richard M. Stallman
4ffab11c42 (restrict_dos_process): Renamed from can_run_dos_process.
(init_ntproc): Refer to restrict_dos_process.
1996-06-12 15:58:53 +00:00
Richard M. Stallman
f249a01280 (init_environment): Read PRELOAD_WINSOCK from registry if
not set in environment.

(winsock_inuse) [HAVE_SOCKETS]: New variable.
(have_winsock) [HAVE_SOCKETS]: Obsolete variable removed.

(term_winsock) [HAVE_SOCKETS]: Only unload winsock library if there
are no active sockets still open, and if the cleanup function
succeeds.  Return TRUE if winsock is unloaded.

(init_winsock) [HAVE_SOCKETS]: Load winsock if not already loaded,
and return TRUE if winsock support is available.  Unload winsock
immediately if new parameter load_now is false.  Check that
WSAStartup supports the winsock version we requested.

(set_errno, check_errno, sys_socket, sys_bind, sys_connect, sys_htons,
sys_ntohs, sys_inet_addr, sys_gethostname, sys_gethostbyname,
sys_getservbyname, sys_close, sys_read, sys_write) [HAVE_SOCKETS]:
Check winsock_lib instead of have_winsock to determine if winsock
support is available.

(sys_socket, sys_close) [HAVE_SOCKETS]: Count sockets in use.

(init_ntproc) [HAVE_SOCKETS]: Only load winsock library on startup
if PRELOAD_WINSOCK is set in environment (or registry).
1996-06-08 00:22:50 +00:00
Richard M. Stallman
9d1778b1b7 (sys_mktemp): Complete rewrite. 1996-06-07 23:07:00 +00:00
Richard M. Stallman
f16140618d (init_winsock): Dynamically link to SetHandleInformation.
(sys_socket): If possible, use SetHandleInformation to make socket
handle non-inheritable to avoid a bug in NT.
1996-06-06 17:07:00 +00:00