| 2143 | } |
| 2144 | |
| 2145 | uae_u32 host_gethostname(TrapContext *ctx, uae_u32 name, uae_u32 namelen) |
| 2146 | { |
| 2147 | if (!trap_valid_address(ctx, name, namelen)) |
| 2148 | return -1; |
| 2149 | char buf[256]; |
| 2150 | if (gethostname(buf, sizeof(buf)) != 0) |
| 2151 | return -1; |
| 2152 | buf[sizeof(buf) - 1] = '\0'; |
| 2153 | trap_put_string(ctx, (uae_char *)buf, name, namelen); |
| 2154 | return 0; |
| 2155 | } |
| 2156 | |
| 2157 | #endif /* ! BSDSOCKET */ |
no test coverage detected