mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-20 05:19:21 +08:00
c3a4634985
some modifications. * init.cc (dll_entry): Revert previous change. * miscfuncs.cc: Include sigproc.h for exit_thread declaration. * winsup.h (ExitThread): Define as 'exit_thread' to ensure no accidental use. * sigproc.cc (exit_thread): New function. (wait_sig): Handle __SIGTHREADEXIT case. Don't just block rather than returning from this function. * sigproc.h (__SIGTHREADEXIT): New enum. (exit_thread): Declare. * sync.cc (muto::release): Accept a tls command-line argument. * sync.h (muto::release): Accept a tls command-line parameter. Default to &_my_tls. * cygerrno.h (__set_errno): Define as extern so that no function code is ever emitted. * cygserver_ipc.h (cygserver_ipc.h): Ditto. * miscfuncs.h (transform_chars): Ditto. * path.h (has_attribute): Ditto. * security.h (privilege_luid): Ditto. * winsup.h (flush_file_buffers): Ditto.
50 lines
1.8 KiB
C++
50 lines
1.8 KiB
C++
/* cygerrno.h: main Cygwin header file.
|
|
|
|
Copyright 2000, 2001, 2002, 2003, 2004, 2010, 2011 Red Hat, Inc.
|
|
|
|
This file is part of Cygwin.
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
details. */
|
|
|
|
#ifndef _CYGERRNO_H
|
|
#define _CYGERRNO_H
|
|
#include <errno.h>
|
|
|
|
void __stdcall seterrno_from_win_error (const char *file, int line, DWORD code) __attribute__ ((regparm(3)));
|
|
void __stdcall seterrno_from_nt_status (const char *file, int line, NTSTATUS status) __attribute__ ((regparm(3)));
|
|
void __stdcall seterrno (const char *, int line) __attribute__ ((regparm(2)));
|
|
int __stdcall geterrno_from_win_error (DWORD code = GetLastError (), int deferrno = 13 /*EACCESS*/) __attribute__ ((regparm(2)));
|
|
int __stdcall geterrno_from_nt_status (NTSTATUS status, int deferrno = 13 /*EACCESS*/) __attribute__ ((regparm(2)));
|
|
|
|
#define __seterrno() seterrno (__FILE__, __LINE__)
|
|
#define __seterrno_from_win_error(val) seterrno_from_win_error (__FILE__, __LINE__, val)
|
|
#define __seterrno_from_nt_status(status) seterrno_from_nt_status (__FILE__, __LINE__, status)
|
|
|
|
extern inline int
|
|
__set_errno (const char *fn, int ln, int val)
|
|
{
|
|
debug_printf ("%s:%d setting errno %d", fn, ln, val);
|
|
return errno = _impure_ptr->_errno = val;
|
|
}
|
|
#define set_errno(val) __set_errno (__PRETTY_FUNCTION__, __LINE__, (val))
|
|
|
|
#define get_errno() (errno)
|
|
extern "C" void __stdcall set_sig_errno (int e);
|
|
|
|
class save_errno
|
|
{
|
|
int saved;
|
|
public:
|
|
save_errno () {saved = get_errno ();}
|
|
save_errno (int what) {saved = get_errno (); set_errno (what); }
|
|
void set (int what) {set_errno (what); saved = what;}
|
|
void reset () {saved = get_errno ();}
|
|
~save_errno () {errno = _impure_ptr->_errno = saved;}
|
|
};
|
|
|
|
extern const char *__sp_fn;
|
|
extern int __sp_ln;
|
|
#endif /*_CYGERRNO_H*/
|