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