43 |
#ifndef __TARGET_GENERIC_NETWORK__ |
#ifndef __TARGET_GENERIC_NETWORK__ |
44 |
#define __TARGET_GENERIC_NETWORK__ |
#define __TARGET_GENERIC_NETWORK__ |
45 |
|
|
|
#ifdef __cplusplus |
|
|
extern "C" { |
|
|
#endif |
|
|
|
|
46 |
/* check if target_native_network.h included */ |
/* check if target_native_network.h included */ |
47 |
#ifndef __TARGET_NATIVE_NETWORK__ |
#ifndef __TARGET_NATIVE_NETWORK__ |
48 |
#error Do NOT INCLUDE generic target files! Include the corresponding native target files instead! |
#error Do NOT INCLUDE generic target files! Include the corresponding native target files instead! |
125 |
#include <unistd.h> |
#include <unistd.h> |
126 |
#define TARGET_NATIVE_NETWORK_GET_HOSTNAME(name,maxNameLen,result) \ |
#define TARGET_NATIVE_NETWORK_GET_HOSTNAME(name,maxNameLen,result) \ |
127 |
do { \ |
do { \ |
128 |
result=(gethostname(name,maxNameLen-1)!=0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \ |
result=(gethostname(name,maxNameLen-1)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \ |
129 |
name[maxNameLen-1]='\0'; \ |
name[maxNameLen-1]='\0'; \ |
130 |
} while (0) |
} while (0) |
131 |
#endif |
#endif |
1274 |
/***************************** Functions *******************************/ |
/***************************** Functions *******************************/ |
1275 |
|
|
1276 |
#ifdef __cplusplus |
#ifdef __cplusplus |
1277 |
|
extern "C" { |
1278 |
|
#endif |
1279 |
|
|
1280 |
|
#ifdef __cplusplus |
1281 |
} |
} |
1282 |
#endif |
#endif |
1283 |
|
|