Commit Graph

116 Commits

Author SHA1 Message Date
Corinna Vinschen 93d66ddc20 * cygwin.din: Export rand_r and ttyname_r.
* syscalls.cc (ttyname_r): New function.
	(ttyname): Move functionality to ttyname_r.  Call it from here.
	* include/cygwin/version.h: Bump API minor number.
2004-04-14 09:12:04 +00:00
Christopher Faylor ca713cfab3 * exceptions.cc (setup_handler): Signal event for any sigwaitinfo if it exists
to force signal to be handled.  Zero event here to prevent races.
* signal.cc (sigwaitinfo): Use local handle value for everything since signal
thread could zero event element at any time.  Detect when awaking due to thread
not in mask and set return value and errno accordingly.  Don't set signal
number to zero unless we've recognized the signal.
* sigproc.cc (sigq): Rename from sigqueue throughout.
* thread.cc (pthread::join): Handle signals received while waiting for thread
to terminate.
* cygwin.din: Export sighold, sigqueue.
* exceptions.cc (sighold): Define new function.
* signal.cc (handle_sigprocmask): Set correct errno for invalid signal.
Simplify debugging output.
(sigqueue): Define new function.
* include/cygwin/signal.h (sighold): Declare new function.
(sigqueue): Ditto.
* include/cygwin/version.h: Bump API minor version number.
* include/limits.h (TIMER_MAX): Define.
(_POSIX_TIMER_MAX): Ditto.
2004-02-26 05:10:49 +00:00
Christopher Faylor 6946073e78 * localtime.cc (localtime_r): Call tzset.
* Makefile.in: Make version.h/cygwin.din version check a warning since it is
not foolproof.
* cygheap.h (CYGHEAPSIZE): Bump size down.
* cygtls.h (_threadinfo::stacklock): New element.
(_threadinfo::pop): Make regparm.
(_threadinfo::lock): New function.
(_threadinfo::unlock): New function.
* cygtls.cc (_threadinfo::push): Wait for a lock on the stack before performing
the operation.
(_threadinfo::pop): Move to another file.
* cygwin.din: More SIGFE changes.
* exceptions.cc (try_to_debug): Always display messages on console.
(handle_exceptions): Unwind stack only when actually about to call sig_send.
(setup_handler): Lock stack prior to performing any operations.
* gendef (_sigfe): Ditto.
(_sigbe): Ditto.
(_threadinfo::pop): Ditto.  Move here.
* gen_tlsoffsets: Generate positive offsets.
* tlsoffsets.h: Regenerate.
2004-02-08 19:59:27 +00:00
Christopher Faylor 656a999a33 * cygwin.din: Make many more functions SIGFE.
* include/cygwin/version.h (CYGWIN_VERSION_SHARED_DATA): Bump.
2004-02-05 19:57:03 +00:00
Christopher Faylor 35711de753 * dcrt0.cc (reent_data): Make global.
* cygwin.din: Reexport reent_data.
2004-01-22 19:14:07 +00:00
Christopher Faylor f6936c48f3 * cygwin/include/signal.h: Add copyright notice.
* cygwin.din: Make clock SIGFE.  Add clock_gettime, sigwaitinfo, timer_create,
timer_delete, timer_settime.
* include/cygwin/version.h: Reflect above additions.
* fork.cc (fork_child): Call fixup_timers_after_fork.
* signal.cc (sigwait): Remove unused variable.
* timer.cc: New file.
(clock_gettime): Define new function.
(timer_tracker): Define new struct used by timer functions.
(timer_tracker::timer_tracker): New function.
(to_us): New function.
(timer_thread): New function.
(timer_tracker::settime): New function.
(timer_create): New function.
(timer_settime): New function.
(timer_delete): New function.
(fixup_timers_after_fork): New function.
* cygthread.cc: Bump thread count.
* signal.cc (sigwaitinfo): Define new function.
(sigwait): Redefine based on sigwaitinfo.
* include/cygwin/signal.h (sigwaitinfo): Declare.
(sigwait): Ditto.
* dtable.cc (dtable::vfork_parent_restore): Avoid double close of ctty when
ctty == ctty_on_hold.
* cygtls.h (_threadinfo::threadkill): New element.
(_threadinfo::set_threadkill): Declare new function.
(_threadinfo::reset_threadkill): Declare new function.
* dcrt0.cc (dcrt0_1): Call here so that it will be possible to attach to
running process with #(*& Windows Me/9x.
(initial_env): Try to initialize strace if uninitialized.
* gendef: Don't zero signal if threadkill is set since that will happen in the
called function.
* signal.cc (sigwait): Ensure cleanup in error conditions.
* sigproc.cc (sig_send): Clear packet mask storage.
(wait_subproc): Fill in child exit code in siginfo_t structure.
* thread.cc (pthread_kill): Set threadkill flag.
* tlsoffsets.h: Regenerate.  Throughout, use siginfo_t to fill out all signal
information for "kernel" signals.
* cygtls.h (_threadinfo::set_siginfo): Declare new function.
* cygtls.cc (_threadinfo::set_siginfo): Define new function.
* dcrt0.cc (do_exit): Accommodate siginfo_t considerations.
* exceptions.cc (handle_exceptions): Ditto.
(sig_handle_tty_stop): Ditto.
(ctrl_c_handler): Use killsys() to send signal.
(sigpacket::process): Rename from sig_handle.  Use siginfo_t field from
sigpacket for everything.
(tty_min::kill_pgrp): Accommodate siginfo_t considerations.
(fhandler_termios::bg_check): Ditto.
* fhandler_tty.cc (fhandler_tty_slave::ioctl): Use killsys() to send signal.
* signal.cc (kill_worker): Rewrite to use siginfo_t second argument.
(kill_pgrp): Ditto.
(kill0): Define new function pulled from kill().
(kill): Rewrite as frontend to kill0.
(killsys): Define new function.
* sigproc.cc (sigelem): Eliminate.
(sigpacket): Move to sigproc.h.  Subsume sigelem.
(pending_signals): Use sigpacket rather than sigelem for everything.
(sig_clear): Ditto.
(wait_sig): Ditto.
(sig_send): Rewrite to use siginfo_t argument.
(sig_send): New function wratpper to sig_send with siginfo_t argument.
(wait_subproc): Accommodate siginfo_t considerations.
* thread.cc (pthread_kill): Ditto.
* sigproc.h (sigpacket): Move here.
(sigpacket::process): Declare "new" function.
(sig_handle): Eliminate declaration.
(sig_send): Declare with new paramaters.
(killsys): Declare new function.
(kill_pgrp): Declare.
* winsup.h: Move some signal-specific stuff to sigproc.h.
* include/cygwin/signal.h: Tweak some siginfo_t stuff.
2004-01-19 05:46:54 +00:00
Christopher Faylor e80cbe3e52 * cygheap.h (init_cygheap): Play more vfork shell games and move ctty_on_hold
and open_fhs_on_hold (back) here.
* dcrt0.cc (_dll_crt0): Just set impure_ptr_ptr here and let later
initialization deal with tls.
* dtable.cc (dtable::vfork_child_fixup): Move ctty considerations here.
(dtable:vfork_parent_restore): And here.
* fork.cc (vfork): Reflect change to ctty handling.
* perthread.h (vfork_save::fhctty): Eliminate.
* cygwin.din: Make more exports NOSIGFE that will never be interrupted by a
signal.
* init.cc (dll_entry): Set stackptr to NULL to catch problems earlier.
2004-01-03 18:15:03 +00:00
Christopher Faylor a7d42fef9f * cygwin.din: Make crt0 functions NOSIGFE.
* include/cygwin/version.h: Gratuitous comment change.
* lib/_cygwin_crt0_common.cc: Remove unneeded declaration.
2003-12-31 06:30:48 +00:00
Christopher Faylor 29d52c8a27 * exceptions.cc (set_signal_mask): Redefine to not pass by address. Report
calculated mask in debugging output.
* sigproc.h (set_signal_mask): Reflect above change in declaration.
* path.cc (mount_item::build_win32): Take path apart before feeding it to
fnmunge.  Throughout, change use of _reent_winsup()-> to _my_tls.locals.
instead.  Throughout, remove obsolete MT_SAFE/_CYG_THREAD_FAILSAFE
considerations.  Througout, add cygtls.h include.
* Makefile.in (DLL_OFILES): Add cygtls.o.  Add some more objects to the
-fomit-frame-pointer list.
* acconfig.h: Remove obsolete settings.
* config.h.in: Ditto.
* bsdlib.cc: Add cygtls.h include.
* configure.in: Remove --enable-extra-threadsafe-checking.
* configure: Regenerate.
* cygtls.h (_local_storage): New struct renamed from _winsup_t (sic).
(_threadinfo:local_clib): Add new field.
(_threadinfo::locals): Ditto.
(_threadinfo::init_thread): Accept second _reent * argument.
(_threadinfo::call): Define as regparm.
(CYGTLS_PADSIZE): Remove unnecessary slop.
(_getreent): Define as a macro.
* thread.h: Remove _CYG_THREAD_FAILSAFE and MT_SAFE stuff.
(_winsup_t): Move to cygtls.h.
(ResourceLocks::ResourceLocks): Eliminate empty constructor.
(MTinterface::reents): Eliminate.
(MTinterface::thread_self_key): Eliminate.
(MTinterface::MTinterface): Eliminate.
* dcrt0.cc: Include stdio.h for _impure_ptr initialization.
(do_global_ctors): Remove run_ctors_p (sic) considerations.  Don't call atexit
here.
(__main): Initialize destructors for user here.
(dll_crt0_1): Accept a dummy argument.  Don't call init_thread here.  Don't set
_impure_ptr here.  Call do_global_ctors after more things have been
initialized.
(_dll_crt0): Define zeros buffer as max of needed size of CYGTLS_PADSIZE so
that it can be used for two purposes while minimizing stack usage.  Initialize
_impure_ptr specifically, for speed.  Call dll_crt0_1 with buffer argument.
(cygwin_dll_init): Call dll_crt0_1 with dummy argument.
* dtable.cc (dtable::find_unused_handle): Remove call to AssertResourceOwner.
* exceptions.cc: Move _threadinfo stuff to new file.
* cygtls.cc: New file.
* gentls_offsets: Accommodate increasing complexity of cygtls.h.
* hires.h (hires_base::~hires_base): Remove.
* init.cc (dll_entry): Remove setting of reents.
* thread.cc: Remove syslog.h include.
(__getreent): Simplify to use _my_tls.
(_reent_winsup): Delete.
(AssertResourceOwner): Delete.
(MTinterface::Init): Remove setting of _clib and _winsup, with all that
entails.
(MTinterface::fixup_after_fork): Ditto.
(pthread::thread_init_wrapper): Ditto.  Also remove call to
set_tls_self_pointer.
(pthread::set_tls_self_pointer): Eliminate.
(pthread::get_tls_self_pointer): Just return _my_tls.tid;
(__reent_t::init_clib): Eliminate.
* tlsoffsets.h: Regenerate.
2003-12-23 16:26:31 +00:00
Corinna Vinschen dc3998682a * Makefile.in (OBSOLETE_FUNCTIONS): Add fcntl.
(NEW_FUNCTIONS): Add fcntl64.
	* cygwin.din: Export fcntl64.  Make fcntl being SIGFE.
	* fcntl.cc (fcntl_worker): New function.
	(fcntl64): New function.
	(_fcntl): Call fcntl_worker.  Convert 32 bit flock structure into
	64 bit flock structure and vice versa.
	* fhandler.cc (fhandler_base::lock): Change 2nd parameter to
	struct __flock64 *.
	* fhandler_disk_file.cc (fhandler_disk_file::lock): Ditto.  Rework
	to be 64 bit aware.
	* fhandler.h: Accomodate above method argument changes.
	* include/cygwin/types.h: Add struct __flock32 and __flock64.
	Define struct flock according to setting of __CYGWIN_USE_BIG_TYPES__.
	* include/cygwin/version.h: Bump API minor number.
2003-12-01 17:26:28 +00:00
Corinna Vinschen f3a1e23eb3 * Makefile.in: (DLL_OFILES): Add flock.o.
* cygwin.din: Export flock.
	* flock.c: New file.
	* include/sys/file.h: Include sys/cdefs.h.
	Add function prototype for flock().
	Add some comments from BSD's header for further clarity.
	(L_SET, L_CURR, L_INCR, L_XTND): Redefine as the macros
	SEEK_SET, SEEK_CUR, SEEK_CUR, & SEEK_END respectively.
	(LOCK_SH,LOCK_EX,LOCK_NB,LOCK_UN): New macros for flock().
	* include/cygwin/version.h: Bump API minor number.
2003-11-29 23:00:51 +00:00
Christopher Faylor 74d893b13c * cygwin.din: Re-add inexplicably missing semaphore/msg functions. 2003-11-28 21:39:08 +00:00
Christopher Faylor 9a4d574b8d Eliminate use of sigframe and sigthread throughout.
* Makefile.in (DLL_OFILES): Add sigfe.o.  Remove reliance on cygwin.def from
cygwin0.dll dependency since dependence on sigfe.o implies that.  Generate def
file on the fly using 'gendef'.
* configure.in: Don't auto-generate cygwin.def.
* configure: Regenerate.
* cygwin.din: Add SIGFE stuff where appropriate.
* dcrt0.cc (dll_crt0_1): Initialize cygwin tls early in process startup.  Set
_main_tls to address of the main thread's cygwin tls.
* debug.h: Remove now unneeded WFSO and WFMO declarations.
* exceptions.cc (_last_thread): Define.
(set_thread_state_for_signals): New function.
(reset_thread_exception_for_signals): Ditto.
(init_thread_for_signals): Ditto.
(delete_thread_for_signals): Ditto.
(capture_thread_for_signals): Ditto.
(handle_exceptions): Set return address explicitly for exceptions prior to
calling sig_send.
(interrupt_on_return): Eliminate.
(setup_handler): Add preliminary implementation for dealing with
thread-specific signals by querying _main_tls.
(signal_exit): Use cygthread::main_thread_id instead of mainthread.id.
(call_signal_handler_now): For now, just handle the main thread.
* fork.cc (vfork): Save and restore main _my_tls.
* gendef: New file.  Generates def file and sigfe.s file.
* gentls_offsets: New file.  Generates offsets for perl to use in sigfe.s.
* how-signals-work.txt: Mention that info is obsolete.
* init.cc (dll_entry): Initialize cygwin tls storage here.
* miscfuncs.cc (low_priority_sleep): Make a C function for easier calling from
asm.
* perthread.h (vfork_save::tls): New element.
* signal.cc (nanosleep): Replace previous use of
sigframe.call_signal_handler_now with straight call to call_signal_handler_now.
(abort): Ditto.
* syscalls.cc (readv): Ditto.
* termios.cc (tcsetattr): Ditto.
* wait.cc (wait4): Ditto.
* sigproc.cc (sig_dispatch_pending): Ditto.
(sig_send): Ditto.
* sigproc.h: Declare call_signal_handler_now.
* thread.cc (pthread::thread_init_wrapper): Initialize cygwin tls.  Remove
obsolete and unworking signal stuff.
* thread.h (verifyable_object::sigs): Eliminate.
(verifyable_object::sigmask): Eliminate.
(verifyable_object::sigtodo): Eliminate.
(verifyable_object::exit): Make attribute noreturn.
(verifyable_object::thread_init_wrapper): Ditto.
(pthread_null::exit): Ditto.
* winbase.h (__stackbase): Always define.
* winsup.h (low_priority_sleep): Declare as a "C" function.
* include/cygwin/version.h: Bump API version to reflect sigwait export.
* include/sys/queue.h: Protect SLIST_ENTRY from previous declaration.
* signal.cc (sigwait): Implement.
* select.cc (fhandler_base::ready_for_read): Add debugging output.
* devices.h: Define more device pointers via their storage.
* devices.in: Don't parse things like /dev/inet/tcp, as they really have no
meaning.
* devices.cc: Regenerate.
* gendevices: Set proper protection for output file.
* cygtls.h: New file.
* gendef: New file.
* gentls_offsets: New file.
* tlsoffsets.h: New file.  Autogenerated.
* config/i386/longjmp.c: Remove.  File subsumed by gendef output.
* config/i386/makefrag: Remove obsolete file.
* fhandler.cc: Remove spurious access_worker declaration.
* spawn.cc (spawnve): Make debugging output more accurate.
* cygwin-gperf: Remove.
* devices.cc: Remove.
2003-11-28 20:55:59 +00:00
Corinna Vinschen a6df500f7d * cygserver.h (client_request::request_code_t): Add
CYGSERVER_REQUEST_MSG and CYGSERVER_REQUEST_SEM.
	(admininstrator_group_sid): Add extern declaration.
	* cygserver_ipc.h: Rewrite.
	* cygserver_msg.h: New file.
	* cygserver_sem.h: New file.
	* cygserver_shm.h: More or less rewrite.
	* cygwin.din: Add msgctl, msgget, msgrcv, msgsnd, semctl, semget and
	semop.
	* msg.cc: Rewrite.
	* safe_memory.h: Remove.
	* sem.cc: Rewrite.
	* shm.cc: Rewrite.
	* include/cygwin/ipc.h: Use appropriate guard.
	(struct ipc_perm): Add seq.
	(IPCID_TO_IX): New define from BSD.
	(IPCID_TO_SEQ): Ditto.
	(IXSEQ_TO_IPCID): Ditto.
	(IPC_R): Ditto.
	(IPC_W): Ditto.
	(IPC_M): Ditto.
	* include/cygwin/msg.h: Use appropriate guard. #ifdef _KERNEL all stuff
	not explicitely defined by SUSv3. Use signed types in structs to match
	types used in BSD.
	(msgqnum_t): Define unsigned.
	(msglen_t): Ditto.
	(struct msqid_ds): Add msg_first and msg_last.
	(struct msginfo): Remove msgpool. Add msgssz and msgseg.
	* include/cygwin/sem.h: Use appropriate guard. #ifdef _KERNEL all stuff
	not explicitely defined by SUSv3. Use signed types in structs to match
	types used in BSD.
	(SEM_UNDO): Define appropriately.
	(struct semid_ds): Add sem_base.
	(struct seminfo): Add semmap and semusz.
	(SEM_A): New define from BSD.
	(SEM_R): Ditto.
	(SEM_ALLOC): Ditto.
	(union semun): Define.
	* include/cygwin/shm.h: Use appropriate guard. #ifdef _KERNEL all stuff
	not explicitely defined by SUSv3. Use signed types in structs to match
	types used in BSD.
	(SHMLBA): Define using cygwin_internal(CW_GET_SHMLBA) call.
	(struct shmid_ds): Add shm_internal.
	(struct shm_info): Rename shm_ids to used_ids as in BSD.  Add define
	for shm_ids.
	* include/cygwin/sysproto.h: New file.
	* include/cygwin/version.h: Bump API minor number.
	* include/sys/ipc.h: New file.
	* include/sys/msg.h: New file.
	* include/sys/queue.h: New file from BSD.
	* include/sys/sem.h: New file.
	* include/sys/shm.h: New file.
	* include/sys/sysproto.h: New file.
2003-11-19 18:50:23 +00:00
Corinna Vinschen 6e17cee57b * bsdlib.cc (getprogname): New function.
(setprogname): New funtion.
	* cygwin.din: Export getprogname and setprogname.
	* include/cygwin/version.h: Bumb API version number.
2003-11-17 17:25:59 +00:00
Corinna Vinschen 03c8f22f77 * Missing patch to cygwin.din. 2003-11-06 21:36:17 +00:00
Corinna Vinschen 56a4ceac3d * Makefile.in (OBSOLETE_FUNCTION): Add tmpfile.
(NEW_FUNCTIONS): Add _tmpfile64 -> tmpfile translation.
	* cygwin.din: Export _tmpfile64
	* include/cygwin/version.h: Bump api minor number.
2003-10-27 13:06:56 +00:00
Corinna Vinschen 072339664d * cygwin.din: Add sem_close, sem_getvalue, sem_open and sem_timedwait.
* pthread.cc (+mangle_sem_name): New function.
	(sem_open): Ditto.
	(sem_close: Ditto.
	(sem_timedwait): Ditto.
	(sem_getvalue): Ditto.
	* thread.cc (semaphore::semaphore): Rearrange member initialization.
	Use appropriate security attribute for process shared semaphores.
	(semaphore::semaphore): New constructor for named semaphores.
	(semaphore::~semaphore): Care for semaphore name.
	(semaphore::_post): Accomodate failing ReleaseSemaphore. Use value
	returned by ReleaseSemaphore vor currentvalue.
	(semaphore::_getvalue): New method.
	(semaphore::_timedwait): Ditto.
	(semaphore::_fixup_after_fork): Rearrange. Don't fail for process
	shared semaphores.
	(semaphore::open): New method.
	(semaphore::timedwait): Ditto.
	(semaphore::post): Fix return value.  Set errno appropriately.
	(semaphore::getvalue): New method.
	* thread.h (class semaphore): Add prototypes for open, getvalue,
	timedwait, _getvalue, _timedwait.  Add prototypes for new constructor.
	Add name member.
	* include/semaphore.h: Add prototypes for sem_open, sem_close,
	sem_timedwait and sem_getvalue.
	include/cygwin/version.h: Bump API minor number.
2003-10-27 11:48:29 +00:00
Corinna Vinschen e217832c4c * Makefile.in: Add $(LIBSERVER) rule.
* cygserver.h: Moved from include/cygwin to here.
	* cygserver_ipc.h: Moved from ../cygserver to here.
	* cygserver_shm.h: Ditto.
	* cygwin.din: Add shmat, shmctl, shmdt and shmget.
	* fhandler_tty.cc (fhandler_tty_slave::open): Don't warn about handle
	dup'ing if not build with USE_SERVER.
	* shm.cc: Include cygerrno.h unconditionally.
	(shmat): Set errno to ENOSYS and return -1 if not build with
	USE_SERVER.
	(shmctl): Ditto.
	(shmdt): Ditto.
	(shmget): Ditto.
	* woutsup.h: Remove.
	* include/cygwin/cygserver_process.h: Moved to ../cygserver directory.
	* include/cygwin/cygserver_transport.h: Ditto.
	* include/cygwin/cygserver_transport_pipes.h: Ditto.
	* include/cygwin/cygserver_transport_sockets.h: Ditto.
	* include/cygwin/version.h: Bump API minor number.
2003-10-22 10:07:59 +00:00
Christopher Faylor de9e39f701 * Makefile.in: Make malloc_wrapper -fomit-frame-pointer.
* cygwin.din: Remove extraneous mallinfo definition.
* dcrt0.cc (quoted): Use strechr for efficiency.
* fhandler.cc (fhandler_base::write): Correctly use get_output_handle rather
than get_handle.
(fhandler_base::lseek): Use method for accessing name in debug output.
2003-09-14 01:58:03 +00:00
Corinna Vinschen 932a40e86b * Makefile.in (DLL_OFILES): Add getopt.o and iruserok.o.
* cygwin.din: Export __check_rhosts_file, __rcmd_errstr, optarg,
	opterr, optind, optopt, optreset, getopt, getopt_long, iruserok
	and ruserok.
	* getopt.c: Moved from lib to here.  Define opt* variables as
	dllexport.
	* iruserok.c: Moved from lib to here.  Rearrange function order.
	Prefer using 64/32 bit functions.
	* syscalls.cc (shell_fp): Define as struct __sFILE64.
	(getusershell): Use fopen64 instead of fopen.
	* winsup.h: Add declarations for seteuid32, fopen64,
	cygwin_gethostbyname and cygwin_inet_addr.
	* include/getopt.h: Declare opt* variables dllimport.
	* include/cygwin/version.h: Bump API minor number.
2003-09-10 19:13:05 +00:00
Corinna Vinschen 34a1d63d80 * Makefile.in (DLL_OFILES): Add bsdlib.o.
* autoload.cc (RegisterServiceProcess): Add.
	* bsdlib.cc: New file.
	(daemon): New function.
	(login_tty): Ditto.
	(openpty): Ditto.
	(forkpty): Ditto.
	* cygwin.din: Export daemon, forkpty, login_tty, logwtmp, updwtmp,
	openpty and revoke.
	* syscalls.cc (updwtmp): New function, writing to wtmp exclusively.
	(logwtmp): Ditto.
	(login): Call updwtmp instead of writing to wtmp by itself.
	(logout): Ditto.
	* tty.cc (revoke): New funtion.
	* include/paths.h: Define _PATH_DEVNULL.
	* include/pty.h: New header.
	* include/cygwin/version.h: Bump API minor number.
	* include/sys/utmp.h: Declare logwtmp with const arguments.
	Declare updwtmp.
	* lib/iruserok.c: New file.
	(ruserok): New function.
	(iruserok): Ditto.
	(__ivaliduser): Ditto.
	(__icheckhost): Ditto.
2003-09-10 15:51:59 +00:00
Corinna Vinschen 24efca1401 * cygwin.din: Export endusershell, getusershell and setusershell.
* syscalls.cc (getusershell): New function.
	(setusershell): Ditto.
	(endusershell): Ditto.
	* include/cygwin/version.h: Bump API minor number.
2003-09-08 20:08:53 +00:00
Corinna Vinschen dcb6ce0cb2 * cygwin.din: Export argz_add argz_add_sep argz_append argz_count
argz_create argz_create_sep argz_delete argz_extract argz_insert
	argz_next argz_replace argz_stringify envz_add envz_entry envz_get
	envz_merge envz_remove envz_strip
	* include/cygwin/version.h: Bump api minor number.
2003-09-08 08:53:01 +00:00
Corinna Vinschen ae89a49602 * cygwin.din: Accomodate change from cygwin_lstat to lstat.
* syscalls.cc: Add defines to avoid declaration issues when
	renaming cygwin_lstat back to lstat.
	(lstat): Reverted name change from cygwin_lstat.
2003-08-13 11:28:42 +00:00
Christopher Faylor 86ed5c8821 * cygwin.din: Export _fdopen64
* Makefile.in (NEW_FUNCTIONS): Add _fdopen64 -> fdopen translation.
* include/cygwin/version.h: Bump api minor number.
* ntdll.h: Remove (now) duplicate FILE_SYNCHRONOUS_IO_NONALERT definition.
2003-07-25 16:13:12 +00:00
Christopher Faylor 1fbeb8274f * environ.cc (check_case_init): Use strncasematch.
* cygwin.din: Export __mempcpy.
* cygwin/version.h: Bump api minor number.
2003-07-24 19:33:14 +00:00
Christopher Faylor c433f4617f Throughout, remove "include <errno.h>" from files which already include
cygerrno.h.
* include/cygwin/config.h (__DYNAMIC_REENT__): Define.
* include/cygwin/version.h: Bump API minor version.
* cygwin.din: Export __getreent
* cygerrno.h: Include errno.h.  Fix places where _impure_ptr is used directly
to store the errno value.
* debug.cc (__set_errno): Ditto.
* errno.cc: Remove _RRENT_ONLY define to get errno.cc compiled.
* signal.cc: Rename _reent_clib to _REENT throughout.
* thread.h (reent_clib): Remove prototype.
* thread.cc (reent_clib): Rename reent_clib to __getreent.  Return _impure_ptr
until MTinterface is initialized.
(reent_winsup): Fix a possible SEGV when _r == NULL.  Return NULL instead.
* MTinterface::fixup_after_fork: Switch reent back to _impure_ptr to keep
signal handling running when fork is called from a thread other than the
mainthread.
2003-06-16 03:24:13 +00:00
Corinna Vinschen 54152c7e7e * cygwin.din: Add vsyslog.
* fhandler.cc (fhandler_base::write): Only make file sparse if the
	seeked area is >= 128K.
	* syslog.cc (vsyslog): New function, overtaking functionality from
	syslog.
	(syslog): Just call vsyslog.
	* include/cygwin/version.h: Bump API minor.
	* include/sys/syslog.h: Add vsyslog declaration.
2003-06-06 08:11:19 +00:00
Corinna Vinschen 10bada05fa * winsup/cygwin/include/cygwin/version.h: Bump API minor version.
* winsup/cygwin/include/cygwin/types.h: Define key_t as long long.
	* winsup/cygwin/cygwin.din: Add ftok, _ftok.
	* winsup/cygwin/ipc.cc (ftok): Rework implementation.
2003-05-20 12:38:04 +00:00
Corinna Vinschen 3e66a81cd1 * Makefile.in (NEW_FUNCTIONS): All 32/64 from 0.79 API get
leading underscore.
	* cygwin.din: Ditto.
	* include/cygwin/version.h: Bump API minor number.
2003-05-09 22:11:25 +00:00
Christopher Faylor c448f78fd5 * termios.cc (setspeed): New function.
(cfsetospeed): Use setspeed to set speed.
(cfsetispeed): Use setspeed to set speed.
* autoload.cc: Add load statement for UuidCreate, and UuidCreateSequential.
* cpuid.h: New file.
* cygwin.din: Export gethostid.
* fhandler_proc.cc (cpuid): Move to cpuid.h.
(can_set_flag): Move to cpuid.h.
* syscalls.cc (gethostid): New function.
* version.h: Bump DLL minor version number to 83.
2003-04-16 03:03:45 +00:00
Corinna Vinschen ac5ec96137 * cygwin.din: Export wcscoll, wcswidth and wcwidth.
* include/cygwin/version.h: Bump API minor number.
2003-04-10 08:22:42 +00:00
Thomas Pfaff 00d296a3f9 * cygwin.din: Add pthread_rwlock_destroy, pthread_rwlock_init,
pthread_rwlock_rdlock, pthread_rwlock_tryrdlock,
pthread_rwlock_wrlock, pthread_rwlock_trywrlock,
pthread_rwlock_unlock, pthread_rwlockattr_init,
pthread_rwlockattr_getpshared, pthread_rwlockattr_setpshared,
and pthread_rwlockattr_destroy.
* include/cygwin/version.h: Bump API minor number.
* include/pthread.h (PTHREAD_RWLOCK_INITIALIZER): Define a
reasonable value.
Add prototypes for pthread_rwlock_destroy, pthread_rwlock_init,
pthread_rwlock_rdlock, pthread_rwlock_tryrdlock,
pthread_rwlock_wrlock, pthread_rwlock_trywrlock,
pthread_rwlock_unlock, pthread_rwlockattr_init,
pthread_rwlockattr_getpshared, pthread_rwlockattr_setpshared,
and pthread_rwlockattr_destroy.
* thread.h (PTHREAD_ONCE_MAGIC): Remove superflous semicolon.
(PTHREAD_RWLOCK_MAGIC): New define.
(PTHREAD_RWLOCKATTR_MAGIC): Ditto.
(pthread_rwlockattr): New class.
(pthread_rwlock): Ditto.
(MTinterface::rwlocks): New member.
(MTinterface::MTinterface): Initialize rwlocks.
Add prototypes for __pthread_rwlock_destroy,
__pthread_rwlock_wrlock, __pthread_rwlock_trywrlock,
__pthread_rwlock_unlock, __pthread_rwlockattr_init,
__pthread_rwlockattr_getpshared, __pthread_rwlockattr_setpshared,
and __pthread_rwlockattr_destroy.
* thread.cc (MTinterface::Init): Initialize rwlock internal mutex.
(MTinterface::fixup_after_fork): Fixup rwlocks after fork.
(pthread_rwlockattr::isGoodObject): Implement.
(pthread_rwlockattr::pthread_rwlockattr): Ditto.
(pthread_rwlockattr::~pthread_rwlockattr): Ditto.
(pthread_rwlock::initMutex): Ditto.
(pthread_rwlock::pthread_rwlock): Ditto.
(pthread_rwlock::~pthread_rwlock): Ditto.
(pthread_rwlock::RdLock): Ditto.
(pthread_rwlock::TryRdLock): Ditto.
(pthread_rwlock::WrLock): Ditto.
(pthread_rwlock::TryWrLock): Ditto.
(pthread_rwlock::UnLock): Ditto.
(pthread_rwlock::addReader): Ditto.
(pthread_rwlock::removeReader): Ditto.
(pthread_rwlock::lookupReader): Ditto.
(pthread_rwlock::RdLockCleanup): Ditto.
(pthread_rwlock::WrLockCleanup): Ditto.
(pthread_rwlock::fixup_after_fork): Ditto.
(pthread_rwlock::isGoodObject): Ditto.
(pthread_rwlock::isGoodInitializer): Ditto.
(pthread_rwlock::isGoodInitializerOrObject): Ditto.
(pthread_rwlock::isGoodInitializerOrBadObject): Ditto.
(__pthread_rwlock_destroy): Ditto.
(pthread_rwlock::init): Ditto.
(__pthread_rwlock_rdlock): Ditto.
(__pthread_rwlock_tryrdlock): Ditto.
(__pthread_rwlock_wrlock): Ditto.
(__pthread_rwlock_trywrlock): Ditto.
2003-03-18 20:01:07 +00:00
Christopher Faylor 3543669fd3 * cygwin.din: Export btowc, trunc.
* include/cygwin/version.h: Reflect new exports.
* syscalls.cc (_stat): Rename to stat to avoid newlib wrapper.
* syscalls.cc (_fstat): Ditto.
* fhandler_console.cc (fhandler_console::close): Correct check for current tty.
Add debugging output when console is freed.
(set_console_state_for_spawn): Add debugging output.
* fhandler_tty.cc (fhandler_tty_slave::open): Don't decrement console open flag
when vforking.
* sigproc.cc (sigproc_terminate): Fix debugging output.
* spawn.cc (handle): Eliminate second argument.
(spawn_guts): Reflect elimination of argument change to handle.
* syscalls.cc (setsid): Add debugging output when console is freed.
* syscalls.cc (rename): Revert assumption that DELETE_ON_CLOSE works on Win9x.
2003-03-17 19:08:11 +00:00
Corinna Vinschen b1aae492d0 Switch to 32/64 datatypes:
* Makefile.in (OBSOLETE_FUNCTIONS): Add open acl aclcheck aclfrommode
	aclfrompbits aclfromtext aclsort acltomode acltopbits acltotext chown
	facl fchown fgetpos fopen freopen fseeko fsetpos fstat ftello
	ftruncate getegid geteuid getgid getgrent getgrgid getgrnam getgroups
	getpwuid getpwuid_r getuid initgroups lchown lseek lstat mknod mmap
	seekdir setegid seteuid setgid setgroups setregid setreuid setuid stat
	telldir truncate.
	(NEW_FUNCTIONS): Add _open64 acl32 aclcheck32 aclfrommode32
	aclfrompbits32 aclfromtext32 aclsort32 acltomode32 acltopbits32
	acltotext32 chown32 facl32 fchown32 fgetpos64 fopen64 freopen64
	fseeko64 fsetpos64 fstat64 ftello64 ftruncate64 getegid32 geteuid32
	getgid32 getgrent32 getgrgid32 getgrnam32 getgroups32 getpwuid32
	getpwuid_r32 getuid32 initgroups32 lchown32 lseek64 lstat64 mknod32
	mmap64 seekdir64 setegid32 seteuid32 setgid32 setgroups32 setregid32
	setreuid32 setuid32 stat64 telldir64 truncate64 to substitute the
	above.
	* cygserver_shm.h (class client_request_shm): Change uid_t and gid_t
	members to __uid32_t and __gid32_t.
	* cygwin.din: Add symbols acl32 aclcheck32 aclfrommode32
	aclfrompbits32 aclfromtext32 aclsort32 acltomode32 acltopbits32
	acltotext32 facl32 fgetpos64 fopen64 freopen64 fseeko64 fsetpos64
	_fstat64 ftello64 _lseek64 mknod32 _open64.
	* glob.c: Include perprocess.h.
	(globtilde): Call getpwuid32 and getuid32 instead of getpwuid and
	getuid.
	(g_lstat): Check for applications API version to call the appropriate
	typed gl_lstat function.
	(g_stat): Ditto for gl_stat.
	* shm.cc (client_request_shm::client_request_shm): Call geteuid32
	and getegid32 instead of geteuid and getegid throughout.
	* syscalls.cc (_open64): New alias for open.
	(_lseek64): New alias for lseek64.
	(_fstat64): New alias for fseek64.
	(mknod32): New function.
	(mknod): Calls mknod32 now.
	* winsup.h: Make function declarations for getuid32, geteuid32,
	and getpwuid32 accessible for plain C sources.  Add declarations
	for getegid32 and getpwnam.
	* include/cygwin/version.h: Bum API minor number to 78.
	* include/sys/cygwin.h: Guard C++ specific members of struct
	per_process against inclusion in plain C sources.
	* include/sys/mman.h (mman): Add guard to avoid type clash when
	compiling Cygwin.
2003-03-09 21:51:00 +00:00
Christopher Faylor 005c3065eb * cygwin.din: Wrap atexit and exit with cygwin, thread-safe functions.
* dcrt0.cc (cygwin_atexit): New function.
(cygwin_exit): Ditto.
2003-03-01 02:02:42 +00:00
Christopher Faylor a066f3645b * cygmalloc.h: Remove MORECORE_CANNOT_TRIM. It's not true. # cygwin.din:
Export mallinfo.  # malloc_wrapper.cc (mallinfo): New function.
2003-02-22 23:02:15 +00:00
Christopher Faylor 878e60c561 * syslog.cc (syslog): Do not print the Windows pid. Print the Cygwin pid as an
unsigned decimal.  On Win95 print a timestamp and attempt to lock the file up
to four times in 3 ms.
2003-02-22 19:35:03 +00:00
Christopher Faylor 8fc16812e8 * cygwin.din: Export all appropriate newlibc libm functions. Sort.
* include/cygwin/version.h: Bump API minor number.
2003-02-16 19:31:07 +00:00
Christopher Faylor f655eadfb4 * cygwin.din: Export all appropriate newlib functions.
* include/cygwin/version.h: Bump API minor number.
2003-02-15 21:45:09 +00:00
Corinna Vinschen 7d33eefa7b * cygwin.din: Export setreuid32, setreuid, setregid32, setregid.
* syscalls.cc (setreuid32): New function.
	(setreuid): Ditto.
	(setregid32): Ditto.
	(setregid): Ditto.
	* include/cygwin/version.h: Bump API minor number.
2003-01-24 15:23:15 +00:00
Corinna Vinschen 89f7e8d1d3 * cygwin.din: Export nanosleep().
* signal.cc (nanosleep): New function.
	(sleep): Move old functionality to nanosleep().  Call nanosleep().
	(usleep): Remove old functionality.  Call nanosleep().
	* include/cygwin/version.h: Bump API minor number.
2003-01-22 10:43:39 +00:00
Corinna Vinschen afa378e74a * cygwin.din: Add strerror_r.
* include/cygwin/version.h: Bump API minor number.
2003-01-17 13:08:06 +00:00
Corinna Vinschen 70d61f30fe * cygwin.din: add asprintf and vasprintf, as well as the reentrant
versions and underscore variants.
	* include/cygwin/version.h: bump CYGWIN_VERSION_API_MINOR.
2003-01-10 12:19:17 +00:00
Christopher Faylor 11b087d571 * cygwin.din: Reflect name change from strtodf to strtof. Export strtof.
* include/cygwin/version.h: Bump API minor number.
2002-12-06 19:48:03 +00:00
Christopher Faylor 838ad58232 * netdb.cc: New file.
* Makeile.in (DLL_OFILES): Add reference to the new netdb.cc file.
* cygwin.din : Add new aliased exports for service and protocol enumerations in
netdb.cc.
2002-12-04 20:44:17 +00:00
Christopher Faylor cdaf88961d * cygwin.din: Export pthread_getsequence_np.
* include/cygwin/version.h: Bump API minor version.
2002-11-27 16:11:40 +00:00
Christopher Faylor 05c728c45b * cygwin.din: Export nl_langinfo().
* include/cygwin/version.h: Bump API minor version.
2002-11-27 02:12:50 +00:00
Christopher Faylor f319cb1ad3 * include/cygwin/version.h: Bump API_MINOR to accommodate below changes.
* cygwin.din (siginterrupt): New export.
* signal.cc (siginterrupt): New.
2002-11-15 19:04:36 +00:00