diff options
author | nw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-05-24 08:41:47 +0000 |
---|---|---|
committer | nw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-05-24 08:41:47 +0000 |
commit | fab2b9cf51632d671d410f49850eec4f1925471d (patch) | |
tree | 62f1fc1fb9fdf41355fa8468756fbb436bfb41e4 | |
parent | fe632043ccec21c3f651f64ca3f1d605136574d9 (diff) | |
download | ATCD-fab2b9cf51632d671d410f49850eec4f1925471d.tar.gz |
*** empty log message ***
-rw-r--r-- | ChangeLog-97a | 20 | ||||
-rw-r--r-- | ace/OS.i | 66 |
2 files changed, 52 insertions, 34 deletions
diff --git a/ChangeLog-97a b/ChangeLog-97a index af07e3eb538..6c3becfabac 100644 --- a/ChangeLog-97a +++ b/ChangeLog-97a @@ -1,3 +1,23 @@ +Sat May 24 03:19:38 1997 Nanbor Wang <nw1@dingo.wolfpack.cs.wustl.edu> + + * ace/OS.i (sigaddset, sigdelset, sigemptyset, sigfillset, + sigismember): Modified the implementation of these function so + as to conform with POSIX standard. Basically all functions do + the same things they did but more conservative protections are + added. The modified semantic becomes, + + sigemptyset, sigfillset, sigaddset, sigdelset: return 0 if + succeed, -1 otherwise. + sigismember: returns 0 if signum is not in the set, 1 if signum + is in the set, and -1 if error occurs. + + If error occured, errno will be set to one of the following + value: + EFAULT: sigset is not a valid address. + EINVAL: signum is not a valid signal number. + + Notice that, so far, this is for NT only. + Sat May 24 01:53:22 1997 James C Hu <jxh@polka.cs.wustl.edu> * performance-tests/Misc/test_naming.cpp (do_testing): Thanks to @@ -912,21 +912,6 @@ ACE_OS::unlink (const char *path) #endif /* VXWORKS */ } -ACE_INLINE char * -ACE_OS::tempnam (const char *dir, const char *pfx) -{ - // ACE_TRACE ("ACE_OS::tempnam"); -#if defined (VXWORKS) - ACE_NOTSUP_RETURN (0); -#else -#if defined (WIN32) - ACE_OSCALL_RETURN (::_tempnam (dir, pfx), char *, 0); -#else - ACE_OSCALL_RETURN (::tempnam (dir, pfx), char *, 0); -#endif /* WIN32 */ -#endif /* VXWORKS */ -} - ACE_INLINE LPTSTR ACE_OS::cuserid (LPTSTR user, size_t maxlen) { @@ -5078,13 +5063,6 @@ ACE_OS::dlsym (void *handle, ACE_DL_TYPE symbolname) #if defined (ACE_HAS_SVR4_DYNAMIC_LINKING) #if defined (ACE_LACKS_POSIX_PROTO) ACE_OSCALL_RETURN (::dlsym (handle, (char*) symbolname), void *, 0); -#elif defined (ACE_USES_ASM_SYMBOL_IN_DLSYM) - char asm_symbolname [MAXPATHLEN] ; - if (strlen (symbolname) + 2 > sizeof asm_symbolname) - return 0 ; - ACE_OS::strcpy (asm_symbolname, "_") ; - ACE_OS::strcpy (asm_symbolname + 1, symbolname) ; - ACE_OSCALL_RETURN (::dlsym (handle, asm_symbolname), void *, 0); #else ACE_OSCALL_RETURN (::dlsym (handle, symbolname), void *, 0); #endif /* ACE_LACKS_POSIX_PROTO */ @@ -5656,12 +5634,6 @@ ACE_OS::open (const char *filename, #endif /* ACE_WIN32 */ } -ACE_INLINE double -ACE_OS::difftime (time_t t1, time_t t0) -{ - return ::difftime (t1, t0); -} - ACE_INLINE char * ACE_OS::ctime (const time_t *t) { @@ -6840,8 +6812,14 @@ ACE_OS::sigaddset (sigset_t *s, int signum) #if !defined (ACE_LACKS_SIGSET) ACE_OSCALL_RETURN (::sigaddset (s, signum), int, -1); #else - if (signum < 1 || signum > NSIG) - return 1 ; // Invalid signum, return error + if (s == NULL) { + errno = EFAULT ; + return -1 ; + } + if (signum < 1 || signum > NSIG) { + errno = EINVAL ; + return -1 ; // Invalid signum, return error + } *s |= (1 << (signum - 1)) ; return 0 ; #endif /* !ACE_LACKS_SIGSET */ @@ -6853,8 +6831,14 @@ ACE_OS::sigdelset (sigset_t *s, int signum) #if !defined (ACE_LACKS_SIGSET) ACE_OSCALL_RETURN (::sigdelset (s, signum), int, -1); #else - if (signum < 1 || signum > NSIG) - return 1 ; // Invalid signum, return error + if (s == NULL) { + errno = EFAULT ; + return -1 ; + } + if (signum < 1 || signum > NSIG) { + errno = EINVAL ; + return -1 ; // Invalid signum, return error + } *s &= ~(1 << (signum - 1)) ; return 0 ; #endif /* !ACE_LACKS_SIGSET */ @@ -6866,6 +6850,10 @@ ACE_OS::sigemptyset (sigset_t *s) #if !defined (ACE_LACKS_SIGSET) ACE_OSCALL_RETURN (::sigemptyset (s), int, -1); #else + if (s == NULL) { + errno = EFAULT ; + return -1 ; + } *s = 0 ; return 0 ; #endif /* !ACE_LACKS_SIGSET */ @@ -6877,6 +6865,10 @@ ACE_OS::sigfillset (sigset_t *s) #if !defined (ACE_LACKS_SIGSET) ACE_OSCALL_RETURN (::sigfillset (s), int, -1); #else + if (s == NULL) { + errno = EFAULT ; + return -1 ; + } *s = ~(sigset_t) 0 ; return 0 ; #endif /* !ACE_LACKS_SIGSET */ @@ -6888,8 +6880,14 @@ ACE_OS::sigismember (sigset_t *s, int signum) #if !defined (ACE_LACKS_SIGSET) ACE_OSCALL_RETURN (::sigismember (s, signum), int, -1); #else - if (signum < 1 || signum > NSIG) - return 1 ; // Invalid signum, return error + if (s == NULL) { + errno = EFAULT ; + return -1 ; + } + if (signum < 1 || signum > NSIG) { + errno = EINVAL ; + return -1 ; // Invalid signum, return error + } return ((*s & (1 << (signum - 1))) != 0) ; #endif /* !ACE_LACKS_SIGSET */ } |