You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@locus.apache.org on 2000/10/15 22:13:26 UTC
cvs commit: apache-2.0/src/os/os2 os.h util_os2.c os.c
wrowe 00/10/15 13:13:25
Modified: src/os/os2 os.h util_os2.c
Removed: src/os/os2 os.c
Log:
This is a pretty significant cleanup of things already moved to OS2's
APR - Brian, please review closely.
Revision Changes Path
1.11 +0 -14 apache-2.0/src/os/os2/os.h
Index: os.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/os/os2/os.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- os.h 2000/10/11 04:24:41 1.10
+++ os.h 2000/10/15 20:13:24 1.11
@@ -96,21 +96,7 @@
/* FIXME: the following should be implemented on this platform */
#define ap_os_is_filename_valid(f) (1)
-/* Use a specialized kill() function */
-int ap_os_kill(int pid, int sig);
-
-/* Maps an OS error code to an error message */
-char *ap_os_error_message(int err);
-
/* OS/2 doesn't have symlinks so S_ISLNK is always false */
#define S_ISLNK(m) 0
-
-/* Dynamic loading functions */
-#define ap_os_dso_handle_t unsigned long
-void ap_os_dso_init(void);
-ap_os_dso_handle_t ap_os_dso_load(const char *);
-void ap_os_dso_unload(ap_os_dso_handle_t);
-void * ap_os_dso_sym(ap_os_dso_handle_t, const char *);
-const char *ap_os_dso_error(void);
#endif /* ! APACHE_OS_H */
1.14 +0 -146 apache-2.0/src/os/os2/util_os2.c
Index: util_os2.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/os/os2/util_os2.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- util_os2.c 2000/08/06 15:07:41 1.13
+++ util_os2.c 2000/10/15 20:13:24 1.14
@@ -170,149 +170,3 @@
strlwr(szCanonicalFile);
return szCanonicalFile;
}
-
-
-
-int ap_os_kill(pid_t pid, int sig)
-{
-/* SIGTERM's don't work too well in OS/2 (only affects other EMX programs).
- CGIs may not be, esp. REXX scripts, so use a native call instead */
-
- int rc;
-
- if ( sig == SIGTERM ) {
- rc = DosSendSignalException( pid, XCPT_SIGNAL_BREAK );
-
- if ( rc ) {
- errno = ESRCH;
- rc = -1;
- }
- } else {
- rc = kill(pid, sig);
- }
-
- return rc;
-}
-
-
-
-char *ap_os_error_message(int err)
-{
- static char result[200];
- unsigned char message[HUGE_STRING_LEN];
- ULONG len;
- char *pos;
- int c;
-
- if (DosGetMessage(NULL, 0, message, HUGE_STRING_LEN, err, "OSO001.MSG", &len) == 0) {
- len--;
- message[len] = 0;
- pos = result;
-
- if (len >= sizeof(result))
- len = sizeof(result-1);
-
- for (c=0; c<len; c++) {
- while (isspace(message[c]) && isspace(message[c+1])) /* skip multiple whitespace */
- c++;
- *(pos++) = isspace(message[c]) ? ' ' : message[c];
- }
-
- *pos = 0;
- } else {
- sprintf(result, "OS/2 error %d", err);
- }
-
- return result;
-}
-
-
-
-
-static int (*os2_select)( int *, int, int, int, long ) = NULL;
-static HMODULE hSO32DLL;
-
-int ap_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
-{
- int *fds, s, fd_count=0, rc;
- int num_read, num_write, num_except;
- long ms_timeout = -1;
-
- if (os2_select == NULL) {
- DosEnterCritSec(); /* Stop two threads doing this at the same time */
-
- if (os2_select == NULL) {
- hSO32DLL = ap_os_dso_load("SO32DLL");
-
- if (hSO32DLL) {
- os2_select = ap_os_dso_sym(hSO32DLL, "SELECT");
- }
- }
- DosExitCritSec();
- }
-
- ap_assert(os2_select != NULL);
- fds = alloca(sizeof(int) * nfds);
-
- if (readfds) {
- for (s=0; s<nfds; s++)
- if (FD_ISSET(s, readfds))
- fds[fd_count++] = _getsockhandle(s);
- }
-
- num_read = fd_count;
-
- if (writefds) {
- for (s=0; s<nfds; s++)
- if (FD_ISSET(s, writefds))
- fds[fd_count++] = _getsockhandle(s);
- }
-
- num_write = fd_count - num_read;
-
- if (exceptfds) {
- for (s=0; s<nfds; s++)
- if (FD_ISSET(s, exceptfds))
- fds[fd_count++] = _getsockhandle(s);
- }
-
- num_except = fd_count - num_read - num_write;
-
- if (timeout)
- ms_timeout = timeout->tv_usec / 1000 + timeout->tv_sec * 1000;
-
- rc = os2_select(fds, num_read, num_write, num_except, ms_timeout);
-
- if (rc > 0) {
- fd_count = 0;
-
- if (readfds) {
- for (s=0; s<nfds; s++) {
- if (FD_ISSET(s, readfds)) {
- if (fds[fd_count++] < 0)
- FD_CLR(s, readfds);
- }
- }
- }
-
- if (writefds) {
- for (s=0; s<nfds; s++) {
- if (FD_ISSET(s, writefds)) {
- if (fds[fd_count++] < 0)
- FD_CLR(s, writefds);
- }
- }
- }
-
- if (exceptfds) {
- for (s=0; s<nfds; s++) {
- if (FD_ISSET(s, exceptfds)) {
- if (fds[fd_count++] < 0)
- FD_CLR(s, exceptfds);
- }
- }
- }
- }
-
- return rc;
-}
RE: cvs commit: apache-2.0/src/os/os2 os.h util_os2.c os.c
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
In case this was missed ... these are hefty changes to os2 that should
affect nothing, but I'm posting here in case this was missed amidst the
volumes of cvs commits. Was this a Good Thing?
> wrowe 00/10/15 13:13:25
>
> Modified: src/os/os2 os.h util_os2.c
> Removed: src/os/os2 os.c
> Log:
> This is a pretty significant cleanup of things already moved to OS2's
> APR - Brian, please review closely.
>
> Revision Changes Path
> 1.11 +0 -14 apache-2.0/src/os/os2/os.h
>
> Index: os.h
> ===================================================================
> RCS file: /home/cvs/apache-2.0/src/os/os2/os.h,v
> retrieving revision 1.10
> retrieving revision 1.11
> diff -u -r1.10 -r1.11
> --- os.h 2000/10/11 04:24:41 1.10
> +++ os.h 2000/10/15 20:13:24 1.11
> @@ -96,21 +96,7 @@
> /* FIXME: the following should be implemented on this platform */
> #define ap_os_is_filename_valid(f) (1)
>
> -/* Use a specialized kill() function */
> -int ap_os_kill(int pid, int sig);
> -
> -/* Maps an OS error code to an error message */
> -char *ap_os_error_message(int err);
> -
> /* OS/2 doesn't have symlinks so S_ISLNK is always false */
> #define S_ISLNK(m) 0
> -
> -/* Dynamic loading functions */
> -#define ap_os_dso_handle_t unsigned long
> -void ap_os_dso_init(void);
> -ap_os_dso_handle_t ap_os_dso_load(const char *);
> -void ap_os_dso_unload(ap_os_dso_handle_t);
> -void * ap_os_dso_sym(ap_os_dso_handle_t, const char *);
> -const char *ap_os_dso_error(void);
>
> #endif /* ! APACHE_OS_H */
>
>
>
> 1.14 +0 -146 apache-2.0/src/os/os2/util_os2.c
>
> Index: util_os2.c
> ===================================================================
> RCS file: /home/cvs/apache-2.0/src/os/os2/util_os2.c,v
> retrieving revision 1.13
> retrieving revision 1.14
> diff -u -r1.13 -r1.14
> --- util_os2.c 2000/08/06 15:07:41 1.13
> +++ util_os2.c 2000/10/15 20:13:24 1.14
> @@ -170,149 +170,3 @@
> strlwr(szCanonicalFile);
> return szCanonicalFile;
> }
> -
> -
> -
> -int ap_os_kill(pid_t pid, int sig)
> -{
> -/* SIGTERM's don't work too well in OS/2 (only affects
> other EMX programs).
> - CGIs may not be, esp. REXX scripts, so use a native
> call instead */
> -
> - int rc;
> -
> - if ( sig == SIGTERM ) {
> - rc = DosSendSignalException( pid, XCPT_SIGNAL_BREAK );
> -
> - if ( rc ) {
> - errno = ESRCH;
> - rc = -1;
> - }
> - } else {
> - rc = kill(pid, sig);
> - }
> -
> - return rc;
> -}
> -
> -
> -
> -char *ap_os_error_message(int err)
> -{
> - static char result[200];
> - unsigned char message[HUGE_STRING_LEN];
> - ULONG len;
> - char *pos;
> - int c;
> -
> - if (DosGetMessage(NULL, 0, message, HUGE_STRING_LEN,
> err, "OSO001.MSG", &len) == 0) {
> - len--;
> - message[len] = 0;
> - pos = result;
> -
> - if (len >= sizeof(result))
> - len = sizeof(result-1);
> -
> - for (c=0; c<len; c++) {
> - while (isspace(message[c]) &&
> isspace(message[c+1])) /* skip multiple whitespace */
> - c++;
> - *(pos++) = isspace(message[c]) ? ' ' : message[c];
> - }
> -
> - *pos = 0;
> - } else {
> - sprintf(result, "OS/2 error %d", err);
> - }
> -
> - return result;
> -}
> -
> -
> -
> -
> -static int (*os2_select)( int *, int, int, int, long ) = NULL;
> -static HMODULE hSO32DLL;
> -
> -int ap_select(int nfds, fd_set *readfds, fd_set *writefds,
> fd_set *exceptfds, struct timeval *timeout)
> -{
> - int *fds, s, fd_count=0, rc;
> - int num_read, num_write, num_except;
> - long ms_timeout = -1;
> -
> - if (os2_select == NULL) {
> - DosEnterCritSec(); /* Stop two threads doing this
> at the same time */
> -
> - if (os2_select == NULL) {
> - hSO32DLL = ap_os_dso_load("SO32DLL");
> -
> - if (hSO32DLL) {
> - os2_select = ap_os_dso_sym(hSO32DLL, "SELECT");
> - }
> - }
> - DosExitCritSec();
> - }
> -
> - ap_assert(os2_select != NULL);
> - fds = alloca(sizeof(int) * nfds);
> -
> - if (readfds) {
> - for (s=0; s<nfds; s++)
> - if (FD_ISSET(s, readfds))
> - fds[fd_count++] = _getsockhandle(s);
> - }
> -
> - num_read = fd_count;
> -
> - if (writefds) {
> - for (s=0; s<nfds; s++)
> - if (FD_ISSET(s, writefds))
> - fds[fd_count++] = _getsockhandle(s);
> - }
> -
> - num_write = fd_count - num_read;
> -
> - if (exceptfds) {
> - for (s=0; s<nfds; s++)
> - if (FD_ISSET(s, exceptfds))
> - fds[fd_count++] = _getsockhandle(s);
> - }
> -
> - num_except = fd_count - num_read - num_write;
> -
> - if (timeout)
> - ms_timeout = timeout->tv_usec / 1000 +
> timeout->tv_sec * 1000;
> -
> - rc = os2_select(fds, num_read, num_write, num_except,
> ms_timeout);
> -
> - if (rc > 0) {
> - fd_count = 0;
> -
> - if (readfds) {
> - for (s=0; s<nfds; s++) {
> - if (FD_ISSET(s, readfds)) {
> - if (fds[fd_count++] < 0)
> - FD_CLR(s, readfds);
> - }
> - }
> - }
> -
> - if (writefds) {
> - for (s=0; s<nfds; s++) {
> - if (FD_ISSET(s, writefds)) {
> - if (fds[fd_count++] < 0)
> - FD_CLR(s, writefds);
> - }
> - }
> - }
> -
> - if (exceptfds) {
> - for (s=0; s<nfds; s++) {
> - if (FD_ISSET(s, exceptfds)) {
> - if (fds[fd_count++] < 0)
> - FD_CLR(s, exceptfds);
> - }
> - }
> - }
> - }
> -
> - return rc;
> -}
>
>
>
>