--- a/UnixOperatingSystem.st Fri Jan 15 15:53:59 2010 +0100
+++ b/UnixOperatingSystem.st Fri Jan 15 16:03:41 2010 +0100
@@ -7047,10 +7047,10 @@
getNumberOfProcessors
"answer the number of physical processors in the system"
-%{
+%{ /* NOCONTEXT */
+
#ifdef _SC_NPROCESSORS_CONF
- int numCPUs = sysconf(_SC_NPROCESSORS_CONF);
- RETURN(__mkSmallInteger(numCPUs));
+ RETURN(__mkSmallInteger(sysconf(_SC_NPROCESSORS_CONF)));
#endif
%}.
@@ -7065,11 +7065,7 @@
"return the (unix-)processId"
%{ /* NOCONTEXT */
-
- int pid;
-
- pid = getpid();
- RETURN ( __mkSmallInteger(pid) );
+ RETURN ( __mkSmallInteger(getpid()) );
%}
"
OperatingSystem getProcessId
@@ -7080,20 +7076,20 @@
"if supported by the OS, return the systemID;
a unique per machine identification.
WARNING:
- not all systems support this; on some, 'unknown' is returned."
-
-%{ /* NO_CONTEXT */
+ not all systems support this; on some, 'unknown' is returned."
+
+%{ /* NOCONTEXT */
#if defined(HAS_SYSINFO) && defined(SI_HW_SERIAL)
{
- char buffer[128];
-
- buffer[0] = 0;
- if (sysinfo(SI_HW_SERIAL, buffer, sizeof(buffer))) {
- buffer[127] = 0;
- if (strlen(buffer) > 0) {
- RETURN(__MKSTRING(buffer));
- }
- }
+ char buffer[128];
+
+ buffer[0] = 0;
+ if (sysinfo(SI_HW_SERIAL, buffer, sizeof(buffer))) {
+ buffer[127] = 0;
+ if (strlen(buffer) > 0) {
+ RETURN(__MKSTRING(buffer));
+ }
+ }
}
#elif defined(HAS_GETHOSTID)
int runningId;
@@ -7109,9 +7105,9 @@
OBJ arr;
if ((retVal = syssgi(SGI_SYSID, idBuffer)) == 0) {
- arr = __BYTEARRAY_UNINITIALIZED_NEW_INT(MAXSYSIDSIZE);
- bcopy(idBuffer, __byteArrayVal(arr), MAXSYSIDSIZE);
- RETURN (arr);
+ arr = __BYTEARRAY_UNINITIALIZED_NEW_INT(MAXSYSIDSIZE);
+ bcopy(idBuffer, __byteArrayVal(arr), MAXSYSIDSIZE);
+ RETURN (arr);
}
#endif
%}.
@@ -8205,29 +8201,6 @@
"
!
-supportsSelect
- "return true, if the OS supports selecting on multiple
- filedescriptors via select.
- If false is returned, ProcessorScheduler will poll in 50ms
- intervals for I/O becoming ready."
-
-%{ /* NOCONTEXT */
-
-#if defined(sco)
- /*
- * sco has a select, but its broken: always waiting 1 second
- */
- RETURN(false);
-#endif
-%}.
- ^ true
-
- "
- OperatingSystem supportsSelect
- "
-
-!
-
supportsSymbolicLinks
"return true, if the OS supports symbolic (soft) links;
most UNIX'es do; many other OS's do not."
@@ -8988,18 +8961,15 @@
!
getGroupID
+ "return the current users (thats you) numeric group id"
+
"{ Pragma: +optSpace }"
- "return the current users (thats you) numeric group id"
%{ /* NOCONTEXT */
- int uid;
-
- uid = getgid();
- RETURN ( __mkSmallInteger(uid) );
-%}.
- ^ 1 "just a dummy for systems which do not have userIDs"
+ RETURN ( __mkSmallInteger(getgid()) );
+%}.
"
OperatingSystem getGroupID
@@ -9094,16 +9064,13 @@
!
getUserID
+ "return the current users (thats you) numeric user id"
+
"{ Pragma: +optSpace }"
- "return the current users (thats you) numeric user id"
-
%{ /* NOCONTEXT */
- int uid;
-
- uid = getuid();
- RETURN ( __mkSmallInteger(uid) );
+ RETURN ( __mkSmallInteger(getuid()) );
%}
"
@@ -12754,11 +12721,11 @@
!UnixOperatingSystem class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.263 2010-01-15 14:53:18 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.264 2010-01-15 15:03:41 stefan Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.263 2010-01-15 14:53:18 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.264 2010-01-15 15:03:41 stefan Exp $'
! !
UnixOperatingSystem initialize!