YARP
Yet Another Robot Platform
PlatformUnistd.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_OS_IMPL_PLATFORMUNISTD_H
10 #define YARP_OS_IMPL_PLATFORMUNISTD_H
11 
12 #include <yarp/conf/system.h>
13 #ifdef YARP_HAS_ACE
14 # include <ace/OS_NS_unistd.h>
15 // In one the ACE headers there is a definition of "main" for WIN32
16 # ifdef main
17 # undef main
18 # endif
19 #else
20 # include <unistd.h>
21 #endif
22 
23 namespace yarp {
24 namespace os {
25 namespace impl {
26 
27 #if defined(YARP_HAS_ACE)
28 using ACE_OS::rmdir;
29 inline int gethostname(char* name, size_t len)
30 {
31  return ACE_OS::hostname(name, len);
32 }
33 using ACE_OS::chdir;
34 using ACE_OS::getcwd;
35 using ACE_OS::getpid;
36 using ACE_OS::getppid;
37 using ACE_OS::isatty;
38 using ACE_OS::unlink;
39 #else
40 using ::chdir;
44 using ::getppid;
45 using ::isatty;
47 using ::unlink;
48 #endif
49 
50 } // namespace impl
51 } // namespace os
52 } // namespace yarp
53 
54 
55 #endif // YARP_OS_IMPL_PLATFORMUNISTD_H
yarp::os::getpid
int getpid()
Portable wrapper for the getppid() function.
Definition: Os.cpp:94
yarp::os::gethostname
void gethostname(char *hostname, size_t size)
Portable wrapper for the gethostname() function.
Definition: Os.cpp:100
yarp::os::getcwd
char * getcwd(char *buf, size_t size)
Portable wrapper for the getcwd() function.
Definition: Os.cpp:115
yarp::os::rmdir
int rmdir(const char *p)
Portable wrapper for the rmdir() function.
Definition: Os.cpp:78
system.h
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18