glibc/posix/execlp.c
Ulrich Drepper b33f91e91d update from main archive 961009
Wed Oct  9 00:24:52 1996  Jim Meyering  <meyering@asic.sc.ti.com>

	* time/strftime.c: Allow old K&R compilers compile this file.

Wed Oct  9 12:03:56 1996  Ulrich Drepper  <drepper@cygnus.com>

	* posix/execlp.c: Add first argument parameter to be compliant
	with POSIX.  Rearrange body to start vararg counter after
	this new argument.

Wed Oct  9 04:34:50 1996  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/sys/procfs.h: Rewrite.  We cannot use
	simply a wrapper around the <linux.elfcore.h> file since the
	kernel header is not clean enough.  We provide the definitions
	in this file instead.

Wed Oct  9 01:43:18 1996  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/gethostid.c (sethostid): Avoid
	get?id calls by using __libc_enable_secure.
1996-10-10 01:07:18 +00:00

43 lines
1.3 KiB
C

/* Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#include <unistd.h>
#include <stdarg.h>
#include <stddef.h>
/* Execute FILE, searching in the `PATH' environment variable if
it contains no slashes, with all arguments after FILE until a
NULL pointer and environment from `environ'. */
int
execlp (const char *file, const char *arg, ...)
{
const char *argv[1024];
unsigned int i;
va_list args;
va_start (args, arg);
argv[i = 0] = arg;
while (argv[i++] != NULL)
argv[i] = va_arg (args, const char *);
va_end (args);
return execvp (file, (char *const *) argv);
}