1
/*===========================================================================
2
Copyright (C) 1995-2009 European Southern Observatory (ESO)
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public License as
6
published by the Free Software Foundation; either version 2 of
7
the License, or (at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public
15
License along with this program; if not, write to the Free
16
Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,
19
Correspondence concerning ESO-MIDAS should be addressed as follows:
20
Internet e-mail: midas@eso.org
21
Postal address: European Southern Observatory
22
Data Management Division
23
Karl-Schwarzschild-Strasse 2
24
D 85748 Garching bei Muenchen
26
===========================================================================*/
28
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
32
.AUTHOR IPG-ESO Garching
33
.CATEGORY Host operating system interfaces. Host services.
34
.ENVIRONMENT UNIX (BSD / SYSV)
36
Provide miscellaneous host services.
37
There are routines translating logicals (environment),
38
getting current process and login info.
39
.VERSION 0.0 25-Aug-1986 Definition. J. D. Ponz
40
.VERSION 1.0 28-Oct-1986 Programmation. B. Pirenne
41
.VERSION 1.5 14-Apr-1987 bsd-sysv compatible. B. Pirenne
42
.VERSION 1.6 15-Jul-1987 oshcpu returns a real number; date through a
44
.VERSION 1.7 10-Dec-1987 Cosmetic changes I. Suisalu
45
.VERSION 2.0 08-Feb-1989 putenv() does not exist in pure BSD. CGS
46
.VERSION 2.1 06-Mar-1990 Added oshpid oshuser oshprn (login infos)
47
.VERSION 2.2 23-May-1990 Corrected bug in BSD version FO
48
.VERSION 2.3 01-Aug-1990 Added oshostname routine (FO)
49
.VERSION 2.4 910911 oshset removed because of putenv. CG
50
.VERSION 2.5 920120 lint: table argument in oshenv removed. CG.
51
.VERSION 2.6 930209 ohsostname routine removed. CG.
54
------------------------------------------------------------*/
57
#include <sys/types.h>
61
#include <proto_os.h> /* ANSI-C prototyping */
68
#define FINISH goto FIN
70
/*==========================================================================
71
* Logical Name Translations
72
*==========================================================================*/
74
/*==========================================================================*/
76
char *oshenv(logname,table)
77
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
79
Translate logical names into physical names., according to a table.
81
Searches the system variable list for the logname.
82
.RETURNS Address of equivalence name / NULL when logname not found
83
.REMARKS table is used only in VMS environment (default is LNM$FILE_DEV).
84
Translation is not case-dependent on VMS. Use recursive translation.
85
------------------------------------------------------------*/
86
char *logname; /* IN : logical name */
87
char *table; /* IN : name of the table to look for (VMS only) */
93
/* 1. Skip the eventual trailing $ */
98
/* 2. Do the logical translation */
101
if (!p) oserror = errno;
107
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
108
.PURPOSE Get process number of current process.
110
.REMARK Only for VMS.
111
-------------------------------------------------------------------- */