Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
26fd740d
Commit
26fd740d
authored
Oct 22, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid reference to glibc internal __libc_fork function.
parent
9abcad52
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
43 deletions
+30
-43
configure
configure
+0
-2
configure.ac
configure.ac
+0
-1
config.h.in
include/config.h.in
+0
-3
pthread.c
scheduler/pthread.c
+30
-37
No files found.
configure
View file @
26fd740d
...
...
@@ -11459,9 +11459,7 @@ fi
for
ac_func
in
\
__libc_fork
\
_lwp_create
\
_pclose
\
_popen
\
...
...
configure.ac
View file @
26fd740d
...
...
@@ -909,7 +909,6 @@ dnl **** Check for functions ****
AC_FUNC_ALLOCA()
AC_CHECK_FUNCS(\
__libc_fork \
_lwp_create \
_pclose \
_popen \
...
...
include/config.h.in
View file @
26fd740d
...
...
@@ -650,9 +650,6 @@
/* Define to 1 if you have the `_strnicmp' function. */
#undef HAVE__STRNICMP
/* Define to 1 if you have the `__libc_fork' function. */
#undef HAVE___LIBC_FORK
/* Define if we have __va_copy */
#undef HAVE___VA_COPY
...
...
scheduler/pthread.c
View file @
26fd740d
...
...
@@ -38,13 +38,6 @@
#include "thread.h"
#include "winternl.h"
static
int
init_done
;
void
PTHREAD_init_done
(
void
)
{
init_done
=
1
;
}
/* Currently this probably works only for glibc2,
* which checks for the presence of double-underscore-prepended
* pthread primitives, and use them if available.
...
...
@@ -62,28 +55,18 @@ void PTHREAD_init_done(void)
asm(".globl " PSTR(alias) "\n" \
"\t.set " PSTR(alias) "," PSTR(orig))
/* strong_alias does not work on external symbols (.o format limitation?),
* so for those, we need to use the pogo stick */
#if defined(__i386__) && !defined(__PIC__)
/* FIXME: PIC */
#define jump_alias(orig, alias) __ASM_GLOBAL_FUNC( alias, "jmp " PSTR(orig))
#endif
static
int
init_done
;
/* get necessary libc symbols */
#if (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1) && defined(HAVE___LIBC_FORK)
#define LIBC_FORK __libc_fork
#define PTHREAD_FORK __fork
#define ALIAS_FORK
#else
#define LIBC_FORK __fork
#define PTHREAD_FORK fork
#endif
extern
pid_t
LIBC_FORK
(
void
);
static
pid_t
(
*
libc_fork
)(
void
);
static
int
(
*
libc_sigaction
)(
int
signum
,
const
struct
sigaction
*
act
,
struct
sigaction
*
oldact
);
void
PTHREAD_init_done
(
void
)
{
init_done
=
1
;
if
(
!
libc_fork
)
libc_fork
=
dlsym
(
RTLD_NEXT
,
"fork"
);
if
(
!
libc_sigaction
)
libc_sigaction
=
dlsym
(
RTLD_NEXT
,
"sigaction"
);
}
#define LIBC_SIGACTION __sigaction
extern
int
LIBC_SIGACTION
(
int
signum
,
const
struct
sigaction
*
act
,
struct
sigaction
*
oldact
);
/* NOTE: This is a truly extremely incredibly ugly hack!
* But it does seem to work... */
...
...
@@ -255,15 +238,20 @@ int __pthread_atfork(void (*prepare)(void),
}
strong_alias
(
__pthread_atfork
,
pthread_atfork
);
pid_t
PTHREAD_FORK
(
void
)
pid_t
__fork
(
void
)
{
pid_t
pid
;
int
i
;
if
(
!
libc_fork
)
{
libc_fork
=
dlsym
(
RTLD_NEXT
,
"fork"
);
assert
(
libc_fork
);
}
EnterCriticalSection
(
&
atfork_section
);
/* prepare handlers are called in reverse insertion order */
for
(
i
=
atfork_count
-
1
;
i
>=
0
;
i
--
)
if
(
atfork_prepare
[
i
])
atfork_prepare
[
i
]();
if
(
!
(
pid
=
LIBC_FORK
()))
if
(
!
(
pid
=
libc_fork
()))
{
InitializeCriticalSection
(
&
atfork_section
);
for
(
i
=
0
;
i
<
atfork_count
;
i
++
)
if
(
atfork_child
[
i
])
atfork_child
[
i
]();
...
...
@@ -275,9 +263,7 @@ pid_t PTHREAD_FORK(void)
}
return
pid
;
}
#ifdef ALIAS_FORK
strong_alias
(
PTHREAD_FORK
,
fork
);
#endif
strong_alias
(
__fork
,
fork
);
/***** MUTEXES *****/
...
...
@@ -658,13 +644,20 @@ int pthread_setcanceltype(int type, int *oldtype)
/***** ANTI-OVERRIDES *****/
/* pthreads tries to override these, point them back to libc */
#ifdef jump_alias
jump_alias
(
LIBC_SIGACTION
,
sigaction
);
#else
int
sigaction
(
int
signum
,
const
struct
sigaction
*
act
,
struct
sigaction
*
oldact
)
{
return
LIBC_SIGACTION
(
signum
,
act
,
oldact
);
if
(
!
libc_sigaction
)
{
libc_sigaction
=
dlsym
(
RTLD_NEXT
,
"sigaction"
);
assert
(
libc_sigaction
);
}
return
libc_sigaction
(
signum
,
act
,
oldact
);
}
#else
/* __GLIBC__ */
void
PTHREAD_init_done
(
void
)
{
}
#endif
#endif
/* __GLIBC__ */
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