diff options
author | Steve Bennett <steveb@workware.net.au> | 2024-04-26 18:57:53 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2024-04-26 18:57:53 +1000 |
commit | bc2a0226c524de0ca8755c9328d26aa89a81d998 (patch) | |
tree | 4ed741adf862f3f0c82659d7195e9ae30d27101a /jim-aio.c | |
parent | 4b980e667b2a07f5ea3aeb437079db9be6f89979 (diff) | |
download | jimtcl-kos-fixes.zip jimtcl-kos-fixes.tar.gz jimtcl-kos-fixes.tar.bz2 |
fixes for kos-portskos-fixes
Ticket #303
Some of these (like missing getpeername) are reasonable, but
it seems like an odd platform that declares but doesn't implement
access and umask, and implements but doesn't declare lstat.
These changes need testing to see if enough works to be useful.
Diffstat (limited to 'jim-aio.c')
-rw-r--r-- | jim-aio.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -641,6 +641,7 @@ static Jim_Obj *aio_sockname(Jim_Interp *interp, int fd) return JimFormatSocketAddress(interp, &sa, salen); } +#ifdef HAVE_GETPEERNAME static Jim_Obj *aio_peername(Jim_Interp *interp, int fd) { union sockaddr_any sa; @@ -651,6 +652,7 @@ static Jim_Obj *aio_peername(Jim_Interp *interp, int fd) } return JimFormatSocketAddress(interp, &sa, salen); } +#endif #endif /* JIM_BOOTSTRAP */ static const char *JimAioErrorString(AioFile *af) @@ -1324,6 +1326,7 @@ static int aio_cmd_sockname(Jim_Interp *interp, int argc, Jim_Obj *const *argv) static int aio_cmd_peername(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { +#ifdef HAVE_GETPEERNAME AioFile *af = Jim_CmdPrivData(interp); Jim_Obj *objPtr = aio_peername(interp, af->fd); @@ -1333,6 +1336,10 @@ static int aio_cmd_peername(Jim_Interp *interp, int argc, Jim_Obj *const *argv) } Jim_SetResult(interp, objPtr); return JIM_OK; +#else + Jim_SetResultString(interp, "not supported", -1); + return JIM_ERR; +#endif } static int aio_cmd_listen(Jim_Interp *interp, int argc, Jim_Obj *const *argv) |