YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
PlatformUnistd.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_OS_IMPL_PLATFORMUNISTD_H
7#define YARP_OS_IMPL_PLATFORMUNISTD_H
8
9#include <yarp/conf/system.h>
10#ifdef YARP_HAS_ACE
11# include <ace/OS_NS_unistd.h>
12// In one the ACE headers there is a definition of "main" for WIN32
13# ifdef main
14# undef main
15# endif
16#else
17# include <unistd.h>
18#endif
19
20namespace yarp::os::impl {
21
22#if defined(YARP_HAS_ACE)
23using ACE_OS::rmdir;
24inline int gethostname(char* name, size_t len)
25{
26 return ACE_OS::hostname(name, len);
27}
28using ACE_OS::chdir;
29using ACE_OS::getcwd;
30using ACE_OS::getpid;
31using ACE_OS::getppid;
32using ACE_OS::isatty;
33using ACE_OS::unlink;
34#else
35using ::chdir;
36using ::getcwd;
37using ::gethostname;
38using ::getpid;
39using ::getppid;
40using ::isatty;
41using ::rmdir;
42using ::unlink;
43#endif
44
45} // namespace yarp::os::impl
46
47
48#endif // YARP_OS_IMPL_PLATFORMUNISTD_H
The components from which ports and connections are built.
std::string gethostname()
Portable wrapper for the gethostname() function.
Definition Os.cpp:98