YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
Os.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARP_OS_OS_H
8#define YARP_OS_OS_H
9
10#include <yarp/os/api.h>
11
12#include <cstddef>
13#include <string>
14
15
16namespace yarp::os {
17
18#ifndef YARP_NO_DEPRECATED // Since YARP 3.4.0
29YARP_DEPRECATED_MSG("Use std::getenv instead")
30YARP_os_API const char* getenv(const char* var);
31#endif // YARP_NO_DEPRECATED
32
41
51YARP_os_API void gethostname(char* hostname, size_t size);
52
60YARP_os_API std::string gethostname();
61
72YARP_os_API int mkdir(const char* p);
73
84YARP_os_API int mkdir_p(const char* p, int ignoreLevels = 0);
85
94YARP_os_API int rmdir(const char* p);
95
106YARP_os_API int rename(const char* oldname, const char* newname);
107
116YARP_os_API int stat(const char* path);
117
130YARP_os_API char* getcwd(char* buf, size_t size);
131
143YARP_os_API void setEnergySavingModeState(bool enabled);
144
145
146#ifndef YARP_NO_DEPRECATED // Since YARP 3.0.0
155YARP_DEPRECATED
157
167YARP_DEPRECATED_MSG("This method is deprecated. Use yarp::os::SystemInfo::getProcessInfo().name instead")
168YARP_os_API void getprogname(char* progname, size_t size);
169
183int fork();
184#endif // YARP_NO_DEPRECATED
185
186
187} // namespace yarp::os
188
189#endif // YARP_OS_OS_H
A mini-server for performing network communication in the background.
#define YARP_DEPRECATED_MSG(MSG)
Expands to either the standard [[deprecated]] attribute or a compiler-specific decorator such as __at...
Definition compiler.h:2885
An interface to the operating system, including Port based communication.
int mkdir(const char *p)
Portable wrapper for the mkdir() function.
Definition Os.cpp:30
int rename(const char *oldname, const char *newname)
Portable wrapper for the rename() function.
Definition Os.cpp:73
void setEnergySavingModeState(bool enabled)
Toggle the OS energy saving feature.
Definition Os.cpp:110
char * getcwd(char *buf, size_t size)
Portable wrapper for the getcwd() function.
Definition Os.cpp:105
int stat(const char *path)
Portable wrapper for the stat() function.
Definition Os.cpp:78
int getpid()
Portable wrapper for the getppid() function.
Definition Os.cpp:84
const char * getenv(const char *var)
Portable wrapper for the getenv() function.
int fork()
Portable wrapper for the fork() function.
int rmdir(const char *p)
Portable wrapper for the rmdir() function.
Definition Os.cpp:68
void setprogname(const char *progname)
Portable wrapper for the setprogname() function.
std::string gethostname()
Portable wrapper for the gethostname() function.
Definition Os.cpp:98
void getprogname(char *progname, size_t size)
Portable wrapper for the getprogname() function.
int mkdir_p(const char *p, int ignoreLevels=0)
Create a directory and all parent directories needed.
Definition Os.cpp:35
#define YARP_os_DEPRECATED_API_MSG(X)
Definition api.h:21
#define YARP_os_API
Definition api.h:18