Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
72ed916a
Commit
72ed916a
authored
21 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Add errno value for thread *_r function call buffer too small. Improve
thread comments.
parent
24d41a9e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/port/thread.c
+14
-1
14 additions, 1 deletion
src/port/thread.c
with
14 additions
and
1 deletion
src/port/thread.c
+
14
−
1
View file @
72ed916a
...
...
@@ -7,7 +7,7 @@
*
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
*
* $Id: thread.c,v 1.
7
2003/09/1
3 14:49:51
momjian Exp $
* $Id: thread.c,v 1.
8
2003/09/1
5 02:30:29
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -17,6 +17,7 @@
#include
<pthread.h>
#include
<sys/types.h>
#include
<pwd.h>
#include
<errno.h>
/*
* Threading sometimes requires specially-named versions of functions
...
...
@@ -48,6 +49,12 @@
* use *_r functions if they exist (configure test)
* 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
* system has thread-safe non-*_r functions.
*/
...
...
@@ -143,7 +150,10 @@ pqGetpwuid(uid_t uid, struct passwd *resultbuf, char *buffer,
*
result
=
resultbuf
;
}
else
{
*
result
=
NULL
;
errno
=
ERANGE
;
}
pthread_mutex_unlock
(
&
getpwuid_lock
);
#endif
...
...
@@ -239,7 +249,10 @@ pqGethostbyname(const char *name,
*
result
=
resultbuf
;
}
else
{
*
result
=
NULL
;
errno
=
ERANGE
;
}
}
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment