"SfR Fresh" - the SfR Freeware/Shareware Archive

Member "eas3pkg/eas3pkg/eas3/c_getpid.c" of archive eas3pkg_v1.6.3.tar.gz:


As a special service "SfR Fresh" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
    1 /*-------------------------------------------------------------------------------------------------------*/
    2 /* EAS3 License                                                                                          */
    3 /*                                                                                                       */
    4 /* Copyright (c) 2006 Institut fuer Aerodynamik und Gasdynamik, Universitaet Stuttgart                   */
    5 /*                                                                                                       */
    6 /* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and     */
    7 /* associated documentation files (the "Software"), to deal in the Software without restriction,         */
    8 /* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, */
    9 /* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, */
   10 /* subject to the following conditions:                                                                  */
   11 /*                                                                                                       */
   12 /* The above copyright notice and this permission notice shall be included in all copies or substantial  */
   13 /* portions of the Software.										 */
   14 /*                                                                                                       */
   15 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT */
   16 /* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   */
   17 /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER          */
   18 /* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION */
   19 /* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                                       */
   20 /*-------------------------------------------------------------------------------------------------------*/
   21 /* **************************************************************** */
   22 /* FORTRAN-Interface f. getpid                                      */
   23 /* (benoetigt f. eindeutige Namen der TMP-Dateinen)                 */
   24 /* **************************************************************** */
   25 
   26 /* getpid returns the process ID of the calling process */
   27 
   28 #include <sys/types.h>
   29 #include <unistd.h>
   30 
   31 /* Anpassung an verschiedene Plattformen */
   32 
   33 #if defined(SX4EW8) || defined(IA32)
   34 #define RETURNVALUE long long
   35 #else
   36 #define RETURNVALUE int
   37 #endif
   38 
   39 #ifdef T3E
   40 #define C_GETPID C_GETPID
   41 #else
   42 #define C_GETPID c_getpid_
   43 #endif
   44 
   45 RETURNVALUE C_GETPID(void)
   46 {
   47   pid_t pid;
   48   pid=getpid();
   49   return ( (RETURNVALUE) pid );
   50 }