summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/syscalls.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-01-28 05:51:15 +0000
committerChristopher Faylor <me@cgf.cx>2001-01-28 05:51:15 +0000
commit2a6fc028badee6ab9a4df2b1b395dbb701d965fb (patch)
tree22d3b565c2f57907367012419b1c63765043d05d /winsup/cygwin/syscalls.cc
parent022ce214de829810a9ddd1a747be03ac95185bb1 (diff)
downloadcygnal-2a6fc028badee6ab9a4df2b1b395dbb701d965fb.tar.gz
cygnal-2a6fc028badee6ab9a4df2b1b395dbb701d965fb.tar.bz2
cygnal-2a6fc028badee6ab9a4df2b1b395dbb701d965fb.zip
Throughout, change 'cygwin_shared.mount' to 'mount_table'.
* child_info.h (child_info): Move shared_h, console_h to cygheap. Add mount_h. * cygheap.h (init_cygheap): Add shared_h, console_h. * cygheap.cc (init_cheap): Initialize heap at a fixed location after the shared memory regions. Initialize cygheap->user name here. * dcrt0.cc (dll_crt0_1): Call getpagesize () to initialize constants. Remove cygheap_init since it is done in shared_init now. (_dll_crt0): Initialize mount_h, remove shared_h and console_h initialization. * fhandler_console.cc (console_shared_h): Eliminate. (get_tty_stuff): Use cygheap->console_h rather than console_shared_h. * heap.cc (heap_init): Use page size constant calculated earlier in initialization. * shared.cc: Eliminate cygwin_shared_h. Add cygwin_mount_h. (mount_table_init): New function for initializing a user mount table. (open_shared_file_map): Use constant for shared memory region. Initialize cygheap and mount table here. (open_shared): Improve debugging output. (shared_info::initialize): Eliminate call to mount.init. (shared_terminate): Use cygheap->shared_h. Close cygwin_mount_h. (open_shared_file_map): Eliminate. * shared_info.h (mount_info): Add a version field. (shared_align_past): New macro for calculating location for shared memory regions. * sigproc.cc (init_child_info): Eliminate shared_h, console_h. * spawn.cc (spawn_guts): Pass on cygwin_mount_h iff not a different user. * syscalls.cc (system_info): New global holding system memory defaults. (getpagesize): Use system_info. * uinfo.cc (internal_getlogin): Only fill in user name if nonexistent. * winsup.h: Declare system_info. * passwd.cc (read_etc_passwd): Use cygheap->user.name () rather than retrieving the name again.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc23
1 files changed, 9 insertions, 14 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index f42c9e126..3945912f3 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -38,6 +38,8 @@ details. */
#include "security.h"
#include "cygheap.h"
+SYSTEM_INFO system_info;
+
/* Close all files and process any queued deletions.
Lots of unix style applications will open a tmp file, unlink it,
but never call close. This function is called by _exit to
@@ -835,7 +837,7 @@ chmod (const char *path, mode_t mode)
NULL, &uid, &gid);
if (win32_path.file_attributes () & FILE_ATTRIBUTE_DIRECTORY)
mode |= S_IFDIR;
- if (! set_file_attribute (win32_path.has_acls (),
+ if (!set_file_attribute (win32_path.has_acls (),
win32_path.get_win32 (),
uid, gid,
mode, cygheap->user.logsrv ())
@@ -1233,8 +1235,8 @@ _rename (const char *oldpath, const char *newpath)
return -1;
}
- if (! writable_directory (real_old.get_win32 ())
- || ! writable_directory (real_new.get_win32 ()))
+ if (!writable_directory (real_old.get_win32 ())
+ || !writable_directory (real_new.get_win32 ()))
{
syscall_printf ("-1 = rename (%s, %s)", oldpath, newpath);
return -1;
@@ -1360,15 +1362,9 @@ getdtablesize ()
extern "C" size_t
getpagesize ()
{
- static DWORD sys_page_size = 0;
-
- if (!sys_page_size)
- {
- SYSTEM_INFO si;
- GetSystemInfo(&si);
- sys_page_size = si.dwPageSize;
- }
- return (int)sys_page_size;
+ if (!system_info.dwPageSize)
+ GetSystemInfo(&system_info);
+ return (int) system_info.dwPageSize;
}
/* FIXME: not all values are correct... */
@@ -1952,8 +1948,7 @@ chroot (const char *newroot)
goto done;
}
char buf[MAX_PATH + 1];
- ret = cygwin_shared->mount.conv_to_posix_path (path.get_win32 (),
- buf, 0);
+ ret = mount_table->conv_to_posix_path (path.get_win32 (), buf, 0);
if (ret)
{
set_errno (ret);