~pac72/ubuntu/lucid/ddd/devel

« back to all changes in this revision

Viewing changes to libiberty/pex-os2.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Schepler
  • Date: 2005-07-10 02:24:07 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050710022407-y2r2z9k2d8aelr94
Tags: 1:3.3.11-1
* New upstream release.
* Rebuild using g++-4.0.
* Drop obsolete Build-Depends on g++ and libstdc++5-3.3-dev.
  Closes: #300216.
* Remove Suggests on bashdb, which no longer exists.  Closes: #294631.
* New patch 003_data_path.diff: change default data directory to
  /usr/share/ddd, with /usr/share/ddd-$(VERSION) as an alternate,
  instead of the other way around.
* New patch 004_userinfo.diff: add --with-userinfo option to configure
  to make it easier to override the autodetection.
* Update to Standards-Version 3.6.2 (no changes needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Utilities to execute a program in a subprocess (possibly linked by pipes
2
 
   with other subprocesses), and wait for it.  OS/2 specialization.
3
 
   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
4
 
   Free Software Foundation, Inc.
5
 
 
6
 
This file is part of the libiberty library.
7
 
Libiberty is free software; you can redistribute it and/or
8
 
modify it under the terms of the GNU Library General Public
9
 
License as published by the Free Software Foundation; either
10
 
version 2 of the License, or (at your option) any later version.
11
 
 
12
 
Libiberty is distributed in the hope that it will be useful,
13
 
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 
Library General Public License for more details.
16
 
 
17
 
You should have received a copy of the GNU Library General Public
18
 
License along with libiberty; see the file COPYING.LIB.  If not,
19
 
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
 
Boston, MA 02111-1307, USA.  */
21
 
 
22
 
#include "pex-common.h"
23
 
 
24
 
#ifdef HAVE_UNISTD_H
25
 
#include <unistd.h>
26
 
#endif
27
 
#ifdef HAVE_STDLIB_H
28
 
#include <stdlib.h>
29
 
#endif
30
 
#ifdef HAVE_SYS_WAIT_H
31
 
#include <sys/wait.h>
32
 
#endif
33
 
 
34
 
/* ??? Does OS2 have process.h?  */
35
 
extern int spawnv ();
36
 
extern int spawnvp ();
37
 
 
38
 
int
39
 
pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
40
 
     const char *program;
41
 
     char * const *argv;
42
 
     const char *this_pname;
43
 
     const char *temp_base;
44
 
     char **errmsg_fmt, **errmsg_arg;
45
 
     int flags;
46
 
{
47
 
  int pid;
48
 
 
49
 
  if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE)
50
 
    abort ();
51
 
  /* ??? Presumably 1 == _P_NOWAIT.  */
52
 
  pid = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (1, program, argv);
53
 
  if (pid == -1)
54
 
    {
55
 
      *errmsg_fmt = install_error_msg;
56
 
      *errmsg_arg = program;
57
 
      return -1;
58
 
    }
59
 
  return pid;
60
 
}
61
 
 
62
 
int
63
 
pwait (pid, status, flags)
64
 
     int pid;
65
 
     int *status;
66
 
     int flags;
67
 
{
68
 
  /* ??? Here's an opportunity to canonicalize the values in STATUS.
69
 
     Needed?  */
70
 
  int pid = wait (status);
71
 
  return pid;
72
 
}