posix: fix unistd.h extern C brace mismatch
If unistd.h is included while CONFIG_POSIX_API is not defined, there is a mismatch of extern C braces that will cause compile errors Signed-off-by: Nicholas Lowell <nlowell@lexmark.com>
This commit is contained in:
parent
855ef90f6d
commit
e4e9b9d8d7
1 changed files with 4 additions and 2 deletions
|
@ -15,11 +15,13 @@
|
||||||
|
|
||||||
#ifdef CONFIG_POSIX_API
|
#ifdef CONFIG_POSIX_API
|
||||||
#include <fs/fs.h>
|
#include <fs/fs.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_POSIX_API
|
||||||
/* File related operations */
|
/* File related operations */
|
||||||
extern int close(int file);
|
extern int close(int file);
|
||||||
extern ssize_t write(int file, const void *buffer, size_t count);
|
extern ssize_t write(int file, const void *buffer, size_t count);
|
||||||
|
@ -37,9 +39,9 @@ static inline int gethostname(char *buf, size_t len)
|
||||||
{
|
{
|
||||||
return zsock_gethostname(buf, len);
|
return zsock_gethostname(buf, len);
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* CONFIG_NETWORKING */
|
||||||
|
|
||||||
#endif
|
#endif /* CONFIG_POSIX_API */
|
||||||
|
|
||||||
unsigned sleep(unsigned int seconds);
|
unsigned sleep(unsigned int seconds);
|
||||||
int usleep(useconds_t useconds);
|
int usleep(useconds_t useconds);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue