source: trunk/src/emx/src/lib/process/spawnvpe.c@ 1289

Last change on this file since 1289 was 1289, checked in by bird, 22 years ago

o Logging and strict features.
o #967: TLS implementation.

  • Property cvs2svn:cvs-rev set to 1.5
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 912 bytes
Line 
1/* spawnvpe.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */
2
3#include "libc-alias.h"
4#include <stdlib.h>
5#include <process.h>
6#include <string.h>
7#include <errno.h>
8#include <sys/syslimits.h>
9#define __LIBC_LOG_GROUP __LIBC_LOG_GRP_PROCESS
10#include <InnoTekLIBC/logstrict.h>
11
12int _STD(spawnvpe)(int mode, const char *name, char * const argv[], char * const envp[])
13{
14 LIBCLOG_ENTER("mode=%#x name=%s argv=%p envp=%p\n", mode, name, argv, envp);
15 char exe[PATH_MAX];
16 char path[PATH_MAX];
17 int rc;
18
19 if (strlen(name) >= sizeof(exe) - 4)
20 {
21 LIBC_ASSERTM_FAILED("name is too long, %d bytes: %s\n", strlen(name), name);
22 errno = ENAMETOOLONG;
23 LIBCLOG_RETURN_INT(-1);
24 }
25 strcpy(exe, name);
26 _defext(exe, "exe");
27 if (!_path(path, exe))
28 LIBCLOG_RETURN_INT(-1);
29 rc = spawnve(mode, path, argv, envp);
30 LIBCLOG_RETURN_INT(rc);
31}
Note: See TracBrowser for help on using the repository browser.