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
6cd88fe6
Commit
6cd88fe6
authored
Apr 02, 2003
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Apr 02, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spawnvp to the portability lib.
parent
17480acb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
0 deletions
+65
-0
port.h
include/wine/port.h
+11
-0
Makefile.in
libs/port/Makefile.in
+1
-0
spawn.c
libs/port/spawn.c
+53
-0
No files found.
include/wine/port.h
View file @
6cd88fe6
...
...
@@ -250,6 +250,16 @@ extern void *memcpy_unaligned( void *dst, const void *src, size_t size );
extern
int
mkstemps
(
char
*
template
,
int
suffix_len
);
/* Process creation flags */
#ifndef _P_WAIT
# define _P_WAIT 0
# define _P_NOWAIT 1
# define _P_OVERLAY 2
# define _P_NOWAITO 3
# define _P_DETACH 4
#endif
extern
int
spawnvp
(
int
mode
,
const
char
*
cmdname
,
char
*
const
argv
[]);
/* Interlocked functions */
#if defined(__i386__) && defined(__GNUC__)
...
...
@@ -321,6 +331,7 @@ extern long interlocked_xchg_add( long *dest, long incr );
#define memmove __WINE_NOT_PORTABLE(memmove)
#define pread __WINE_NOT_PORTABLE(pread)
#define pwrite __WINE_NOT_PORTABLE(pwrite)
#define spawnvp __WINE_NOT_PORTABLE(spawnvp)
#define statfs __WINE_NOT_PORTABLE(statfs)
#define strcasecmp __WINE_NOT_PORTABLE(strcasecmp)
#define strerror __WINE_NOT_PORTABLE(strerror)
...
...
libs/port/Makefile.in
View file @
6cd88fe6
...
...
@@ -16,6 +16,7 @@ C_SRCS = \
mkstemps.c
\
pread.c
\
pwrite.c
\
spawn.c
\
statfs.c
\
strcasecmp.c
\
strerror.c
\
...
...
libs/port/spawn.c
0 → 100644
View file @
6cd88fe6
/*
* spawnvp function
*
* Copyright 2003 Dimitrie O. Paun
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "wine/port.h"
#include <errno.h>
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
int
spawnvp
(
int
mode
,
const
char
*
cmdname
,
char
*
const
argv
[])
{
#ifndef HAVE__SPAWNVP
int
pid
=
0
,
status
,
wret
;
if
(
mode
!=
_P_OVERLAY
)
pid
=
fork
();
if
(
pid
==
0
)
pid
=
execvp
(
argv
[
0
],
argv
);
if
(
pid
<
0
)
return
-
1
;
if
(
mode
!=
_P_WAIT
)
return
pid
;
while
(
pid
!=
(
wret
=
waitpid
(
pid
,
&
status
,
0
)))
if
(
wret
==
-
1
&&
errno
!=
EINTR
)
break
;
if
(
pid
==
wret
&&
WIFEXITED
(
status
))
return
WEXITSTATUS
(
status
);
return
255
;
/* abnormal exit with an abort or an interrupt */
#else
/* HAVE__SPAWNVP */
return
_spawnvp
(
mode
,
cmdname
,
argv
);
#endif
/* HAVE__SPAWNVP */
}
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