Throughout, change fdtab references to cygheap->fdtab.

* child_info.h (cygheap_exec_info): Eliminate special fdtab stuff.
* spawn.cc (spawn_guts): Ditto.
* cygheap.cc (cygheap_init): Initialize fdtab, if appropriate.
* cygheap.h (CYGHEAPSIZE): Include size of init_cygheap.
(_cmalloc_entry): Include fdtab here.
* dtable.h (dtable): Declare/define new methods.
* dtable.cc (dtable::vfork_child_fixup): New method.
(dtable::fixup_after_exec): Remove unneeded extra arguments.
* dcrt0.cc (dll_crt0_1): Ditto.
* environ.cc (getwinenv): Use case sensitive comparison.
(winenv): Make a copy of environment cache to avoid realloc problems when
duplicate environment variables exist in the environment.  (From Egor Duda)
* net.cc (cygwin_socket): Revert Apr 14 change.
* include/sys/file.h: Protect against previous X_OK definition.
* passwd.cc: Eliminate passwd_sem throughout.
* security.cc: Ditto.
* cygwin.din: Export New functions.
* passwd.cc (read_etc_passwd): Make race safe.
(getpwuid_r): New function.
(getpwnam_r): New function.
This commit is contained in:
Christopher Faylor
2001-04-18 21:10:15 +00:00
parent a2d47fe9d9
commit 0381fec68f
39 changed files with 400 additions and 230 deletions

View File

@@ -61,8 +61,8 @@ class mmap_record
base_address_ (b),
map_map_ (NULL)
{
if (fd >= 0 && !fdtab.not_open (fd))
devtype_ = fdtab[fd]->get_device ();
if (fd >= 0 && !cygheap->fdtab.not_open (fd))
devtype_ = cygheap->fdtab[fd]->get_device ();
}
/* Default Copy constructor/operator=/destructor are ok */
@@ -231,7 +231,7 @@ mmap_record::alloc_fh ()
the call to fork(). This requires creating a fhandler
of the correct type to be sure to call the method of the
correct class. */
return fdtab.build_fhandler (-1, get_device (), "", 0);
return cygheap->fdtab.build_fhandler (-1, get_device (), "", 0);
}
void
@@ -355,7 +355,7 @@ map::get_list_by_fd (int fd)
#else /* so we use the name hash value to identify the file unless
it's not an anonymous mapping. */
if ((fd == -1 && lists[i]->fd == -1)
|| (fd != -1 && lists[i]->hash == fdtab[fd]->get_namehash ()))
|| (fd != -1 && lists[i]->hash == cygheap->fdtab[fd]->get_namehash ()))
#endif
return lists[i];
return 0;
@@ -366,7 +366,7 @@ map::add_list (list *l, int fd)
{
l->fd = fd;
if (fd != -1)
l->hash = fdtab[fd]->get_namehash ();
l->hash = cygheap->fdtab[fd]->get_namehash ();
if (nlists == maxlists)
{
maxlists += 5;
@@ -471,14 +471,14 @@ mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t off)
if (fd != -1)
{
/* Ensure that fd is open */
if (fdtab.not_open (fd))
if (cygheap->fdtab.not_open (fd))
{
set_errno (EBADF);
syscall_printf ("-1 = mmap(): EBADF");
ReleaseResourceLock(LOCK_MMAP_LIST,READ_LOCK|WRITE_LOCK," mmap");
return MAP_FAILED;
}
fh = fdtab[fd];
fh = cygheap->fdtab[fd];
if (fh->get_device () == FH_DISK)
{
DWORD fsiz = GetFileSize (fh->get_handle (), NULL);