Date: 05/31/98
- Next message: shane: "[PHP-DEV] CVS update: php31/main"
- Previous message: shane: "[PHP-DEV] CVS update: php3/functions"
- Next in thread: shane: "[PHP-DEV] CVS update: php31/ext/standard"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sunday May 31, 1998 @ 12:44
Author: shane
Update of /repository/php31/ext/standard
In directory asf:/tmp/cvs-serv25702/ext/standard
Modified Files:
basic_functions.c info.c pageinfo.c pageinfo.h
Log Message:
Added getmyiid for getting instance or thread id's. Change sapi to expect
php3_globals as the first param to its functions, as some server modules
may need information from the globals (such as request ini variables).
Index: php31/ext/standard/basic_functions.c
diff -c php31/ext/standard/basic_functions.c:1.7 php31/ext/standard/basic_functions.c:1.8
*** php31/ext/standard/basic_functions.c:1.7 Sun May 31 09:19:03 1998
--- php31/ext/standard/basic_functions.c Sun May 31 12:44:22 1998
***************
*** 192,197 ****
--- 192,198 ----
{"getmyuid", php3_getmyuid, NULL},
{"getmypid", php3_getmypid, NULL},
+ {"getmyiid", php3_getmyinstanceid, NULL},
{"getmyinode", php3_getmyinode, NULL},
{"getlastmod", php3_getlastmod, NULL},
Index: php31/ext/standard/info.c
diff -c php31/ext/standard/info.c:1.2 php31/ext/standard/info.c:1.3
*** php31/ext/standard/info.c:1.2 Wed May 27 23:25:27 1998
--- php31/ext/standard/info.c Sun May 31 12:44:22 1998
***************
*** 233,239 ****
PUTS("</table>");
#if USE_SAPI /* call a server module specific info function */
! GLOBAL(sapi_rqst)->info(GLOBAL(sapi_rqst));
#endif
SECTION("Environment");
--- 233,239 ----
PUTS("</table>");
#if USE_SAPI /* call a server module specific info function */
! GLOBAL(sapi_rqst)->info(php3_globals);
#endif
SECTION("Environment");
Index: php31/ext/standard/pageinfo.c
diff -c php31/ext/standard/pageinfo.c:1.3 php31/ext/standard/pageinfo.c:1.4
*** php31/ext/standard/pageinfo.c:1.3 Wed May 27 23:25:28 1998
--- php31/ext/standard/pageinfo.c Sun May 31 12:44:22 1998
***************
*** 113,120 ****
{
int pid;
TLS_VARS;
!
pid = getpid();
if (pid < 0) {
RETURN_FALSE;
} else {
--- 113,145 ----
{
int pid;
TLS_VARS;
!
pid = getpid();
+ if (pid < 0) {
+ RETURN_FALSE;
+ } else {
+ RETURN_LONG((long) pid);
+ }
+ }
+
+ /*
+ returns the thread id of the current request.
+ if it cant get the thread id, returns the pid.
+ That way, this function can be used for cross-system
+ scripts that typicaly use getpid for unique id's.
+ Leaving getmypid alone because there may be instances
+ where someone in a threaded environment realy wants
+ the pid, and not the thread id.
+ */
+ void php3_getmyinstanceid(INTERNAL_FUNCTION_PARAMETERS)
+ {
+ int pid;
+ TLS_VARS;
+
+ #if defined(THREAD_SAFE) && (WIN32|WINNT)
+ pid = GetCurrentThreadId();
+ #endif
+ if(!pid)pid = getpid();
if (pid < 0) {
RETURN_FALSE;
} else {
Index: php31/ext/standard/pageinfo.h
diff -c php31/ext/standard/pageinfo.h:1.1.1.1 php31/ext/standard/pageinfo.h:1.2
*** php31/ext/standard/pageinfo.h:1.1.1.1 Tue May 26 22:26:58 1998
--- php31/ext/standard/pageinfo.h Sun May 31 12:44:23 1998
***************
*** 3,8 ****
--- 3,9 ----
extern void php3_getmyuid(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_getmypid(INTERNAL_FUNCTION_PARAMETERS);
+ extern void php3_getmyinstanceid(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_getmyinode(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_getlastmod(INTERNAL_FUNCTION_PARAMETERS);
- Next message: shane: "[PHP-DEV] CVS update: php31/main"
- Previous message: shane: "[PHP-DEV] CVS update: php3/functions"
- Next in thread: shane: "[PHP-DEV] CVS update: php31/ext/standard"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

