Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
d56b736d
Commit
d56b736d
authored
Apr 04, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update thread test to do getpid() in while loop, also use weather.com
rather than slashdot.org for testing.
parent
8efbe30d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
src/tools/thread/thread_test.c
src/tools/thread/thread_test.c
+7
-7
No files found.
src/tools/thread/thread_test.c
View file @
d56b736d
...
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.
9 2004/03/28 02:37:31
momjian Exp $
* $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.
10 2004/04/04 17:23:54
momjian Exp $
*
* This program tests to see if your standard libc functions use
* pthread_setspecific()/pthread_getspecific() to be thread-safe.
...
...
@@ -105,7 +105,7 @@ void func_call_1(void) {
/* wait for other thread to set errno */
errno1_set
=
1
;
while
(
errno2_set
==
0
)
/* loop */
;
getpid
();
/* force system call */
if
(
errno
!=
EEXIST
)
{
fprintf
(
stderr
,
"errno not thread-safe; exiting
\n
"
);
...
...
@@ -128,8 +128,8 @@ void func_call_1(void) {
passwd_p1
=
NULL
;
/* force thread-safe failure report */
}
hostent_p1
=
gethostbyname
(
"yahoo.com"
);
p
=
gethostbyname
(
"
slashdot.org
"
);
hostent_p1
=
gethostbyname
(
"
www.
yahoo.com"
);
p
=
gethostbyname
(
"
www.weather.com
"
);
if
(
hostent_p1
!=
p
)
{
printf
(
"Your gethostbyname() changes the static memory area between calls
\n
"
);
...
...
@@ -151,7 +151,7 @@ void func_call_2(void) {
/* wait for other thread to set errno */
errno2_set
=
1
;
while
(
errno1_set
==
0
)
/* loop */
;
getpid
();
/* force system call */
if
(
errno
!=
ENOENT
)
{
fprintf
(
stderr
,
"errno not thread-safe; exiting
\n
"
);
...
...
@@ -174,8 +174,8 @@ void func_call_2(void) {
passwd_p2
=
NULL
;
/* force thread-safe failure report */
}
hostent_p2
=
gethostbyname
(
"google.com"
);
p
=
gethostbyname
(
"postgresql.org"
);
hostent_p2
=
gethostbyname
(
"
www.
google.com"
);
p
=
gethostbyname
(
"
www.
postgresql.org"
);
if
(
hostent_p2
!=
p
)
{
printf
(
"Your gethostbyname() changes the static memory area between calls
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment