Whamcloud - gitweb
* Landed portals:b_port_step as follows...
[fs/lustre-release.git] / lnet / lnet / lib-pid.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * lib/lib-pid.c
5  *
6  * Process identification routines
7  * Copyright (C) 2001-2003 Cluster File Systems, Inc.
8  *
9  *   This file is part of Lustre, http://www.lustre.org
10  *
11  *   Lustre is free software; you can redistribute it and/or
12  *   modify it under the terms of version 2 of the GNU General Public
13  *   License as published by the Free Software Foundation.
14  *
15  *   Lustre is distributed in the hope that it will be useful,
16  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  *   GNU General Public License for more details.
19  *
20  *   You should have received a copy of the GNU General Public License
21  *   along with Lustre; if not, write to the Free Software
22  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  */
24
25 /* This should be removed.  The NAL should have the PID information */
26 #define DEBUG_SUBSYSTEM S_PORTALS
27
28 #if defined (__KERNEL__)
29 extern int getpid(void);
30 #else
31 #       include <stdio.h>
32 #       include <unistd.h>
33 #endif
34 #include <portals/lib-p30.h>
35
36 int
37 lib_api_get_id(nal_t *apinal, ptl_process_id_t *pid)
38 {
39         lib_nal_t *nal = apinal->nal_data;
40         
41         *pid = nal->libnal_ni.ni_pid;
42         return PTL_OK;
43 }