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
72ed916a
Commit
72ed916a
authored
Sep 15, 2003
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add errno value for thread *_r function call buffer too small. Improve
thread comments.
parent
24d41a9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
src/port/thread.c
src/port/thread.c
+14
-1
No files found.
src/port/thread.c
View file @
72ed916a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
*
*
* $Id: thread.c,v 1.
7 2003/09/13 14:49:51
momjian Exp $
* $Id: thread.c,v 1.
8 2003/09/15 02:30:29
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#include <pthread.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/types.h>
#include <pwd.h>
#include <pwd.h>
#include <errno.h>
/*
/*
* Threading sometimes requires specially-named versions of functions
* Threading sometimes requires specially-named versions of functions
...
@@ -48,6 +49,12 @@
...
@@ -48,6 +49,12 @@
* use *_r functions if they exist (configure test)
* use *_r functions if they exist (configure test)
* do our own locking and copying of non-threadsafe functions
* do our own locking and copying of non-threadsafe functions
*
*
* The disadvantage of the last option is not the thread overhead but
* the fact that all function calls are serialized, and with gethostbyname()
* requiring a DNS lookup, that could be slow.
*
* One thread-safe solution for gethostbyname() might be to use getaddrinfo().
*
* Compile and run src/tools/test_thread_funcs.c to see if your operating
* Compile and run src/tools/test_thread_funcs.c to see if your operating
* system has thread-safe non-*_r functions.
* system has thread-safe non-*_r functions.
*/
*/
...
@@ -143,7 +150,10 @@ pqGetpwuid(uid_t uid, struct passwd *resultbuf, char *buffer,
...
@@ -143,7 +150,10 @@ pqGetpwuid(uid_t uid, struct passwd *resultbuf, char *buffer,
*
result
=
resultbuf
;
*
result
=
resultbuf
;
}
}
else
else
{
*
result
=
NULL
;
*
result
=
NULL
;
errno
=
ERANGE
;
}
pthread_mutex_unlock
(
&
getpwuid_lock
);
pthread_mutex_unlock
(
&
getpwuid_lock
);
#endif
#endif
...
@@ -239,7 +249,10 @@ pqGethostbyname(const char *name,
...
@@ -239,7 +249,10 @@ pqGethostbyname(const char *name,
*
result
=
resultbuf
;
*
result
=
resultbuf
;
}
}
else
else
{
*
result
=
NULL
;
*
result
=
NULL
;
errno
=
ERANGE
;
}
}
}
#endif
#endif
...
...
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