* dlopen.c (dlopen): Return NULL when name is NULL (suggested by
chrisiasci@aol.com). * cygwin.din: Add a new, internally used export - _check_for_executable. * dcrt0.cc (dll_crt0_1): Set _check_for_executable for older binaries. Pass user_data to premain functions. * fhandler.cc (fhandler_disk_file::open): Only check for executable if the linked program is intereested in the executable bit. (fhandler_disk_file::check_execable_p): Delete. * fhandler.h (executable_states): New enumeration of various states of executable bit caring. (fhandler_base::set_execable_p): New method. * fhandler_termios.cc (fhandler_termios::line_edit): Flag when a signal has been sent to the tty. Return -1 when this is so. * fhandler_console.cc (fhandler_console::read): Return -1 when signal sending character encountered. * path.cc (path_conv::check): Record when path refers to a disk device. Move executable extension check here. (check_sysfile): Accomodate new EXEC path states. (has_suffix): Remove. (next_suffix): Remove. (class suffix_scan): New clas. (suffix_scan::has): New method. (suffix_scan:next): New method. (symlink_info::check): Use suffix_scan method to control for scanning for suffixes. * path.h (path_conv::exec_state): New method. * perprocess.h: Make "C" friendly. * include/cygwin/version.h: Define CYGWIN_VERSION_CHECK_FOR_S_IEXEC. Bump CYGWIN_VERSION_API_MINOR. * include/sys/cygwin.h: Change premain declarations. * winsup.h: Move __cplusplus test to after builtin defines.
This commit is contained in:
@@ -79,7 +79,9 @@ details. */
|
||||
(CYGWIN_VERSION_DLL_MAKE_COMBINED (user_data->api_major, user_data->api_minor) <= \
|
||||
20)
|
||||
|
||||
|
||||
#define CYGWIN_VERSION_CHECK_FOR_S_IEXEC \
|
||||
(CYGWIN_VERSION_DLL_MAKE_COMBINED (user_data->api_major, user_data->api_minor) >= \
|
||||
36)
|
||||
/* We used to use the DLL major/minor to track
|
||||
non-backward-compatible interface changes to the API. Now we
|
||||
use an API major/minor number for this purpose. */
|
||||
@@ -127,10 +129,11 @@ details. */
|
||||
34: Separated out mount table
|
||||
35: Export drand48, erand48, jrand48, lcong48, lrand48,
|
||||
mrand48, nrand48, seed48, and srand48.
|
||||
36: Added _cygwin_S_IEXEC, et al
|
||||
*/
|
||||
|
||||
#define CYGWIN_VERSION_API_MAJOR 0
|
||||
#define CYGWIN_VERSION_API_MINOR 35
|
||||
#define CYGWIN_VERSION_API_MINOR 36
|
||||
|
||||
/* There is also a compatibity version number associated with the
|
||||
shared memory regions. It is incremented when incompatible
|
||||
|
@@ -31,11 +31,6 @@ extern int cygwin_conv_to_full_posix_path (const char *, char *);
|
||||
extern int cygwin_posix_path_list_p (const char *);
|
||||
extern void cygwin_split_path (const char *, char *, char *);
|
||||
|
||||
extern void cygwin_premain0 (int argc, char **argv);
|
||||
extern void cygwin_premain1 (int argc, char **argv);
|
||||
extern void cygwin_premain2 (int argc, char **argv);
|
||||
extern void cygwin_premain3 (int argc, char **argv);
|
||||
|
||||
struct __cygwin_perfile
|
||||
{
|
||||
const char *name;
|
||||
@@ -149,7 +144,7 @@ struct per_process
|
||||
|
||||
void *(*calloc)(size_t, size_t);
|
||||
/* For future expansion of values set by the app. */
|
||||
void (*premain[4]) (int, char **);
|
||||
void (*premain[4]) (int, char **, struct per_process *);
|
||||
|
||||
/* The rest are *internal* to cygwin.dll.
|
||||
Those that are here because we want the child to inherit the value from
|
||||
@@ -165,7 +160,7 @@ struct per_process
|
||||
void *heapptr; /* current index into heap */
|
||||
void *heaptop; /* current top of heap */
|
||||
|
||||
DWORD unused1; /* unused */
|
||||
DWORD unused1;
|
||||
|
||||
/* Non-zero means the task was forked. The value is the pid.
|
||||
Inherited from parent. */
|
||||
@@ -190,6 +185,11 @@ struct per_process
|
||||
};
|
||||
#define per_process_overwrite ((unsigned) &(((struct per_process *) NULL)->resourcelocks))
|
||||
|
||||
extern void cygwin_premain0 (int argc, char **argv, struct per_process *);
|
||||
extern void cygwin_premain1 (int argc, char **argv, struct per_process *);
|
||||
extern void cygwin_premain2 (int argc, char **argv, struct per_process *);
|
||||
extern void cygwin_premain3 (int argc, char **argv, struct per_process *);
|
||||
|
||||
extern void cygwin_set_impersonation_token (const HANDLE);
|
||||
|
||||
/* included if <windows.h> is included */
|
||||
|
@@ -24,7 +24,13 @@
|
||||
|
||||
|
||||
#define F_OK 0 /* does file exist */
|
||||
#define X_OK 1 /* is it executable by caller */
|
||||
#define _X_OK 1 /* is it executable by caller */
|
||||
#if defined (__CYGWIN__) || defined (__INSIDE_CYGWIN__)
|
||||
# define X_OK _X_OK /* Check for execute permission. */
|
||||
#else
|
||||
extern const unsigned _cygwin_X_OK;
|
||||
# define X_OK _cygwin_X_OK
|
||||
#endif
|
||||
#define W_OK 2 /* is it writable by caller */
|
||||
#define R_OK 4 /* is it readable by caller */
|
||||
|
||||
|
Reference in New Issue
Block a user