aboutsummaryrefslogtreecommitdiff
path: root/jim-aio.c
AgeCommit message (Collapse)AuthorFilesLines
2012-09-06aio seek and tell should allow for 64 bit offsetsSteve Bennett1-5/+13
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2012-02-27Add support for aio command: isattySteve Bennett1-0/+19
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2012-02-14Use JIM_WIDE_MAX rather than LLONG_MAXSteve Bennett1-1/+1
For platforms which don't have long long Signed-off-by: Steve Bennett <steveb@workware.net.au>
2012-02-02Allow 'aio copyto' and 'aio read' to copy >2GBSteve Bennett1-9/+6
Signed-off-by: Steve Bennett <steveb@workware.net.au> Reported-by: af123 <jimdevel@hummypkg.org.uk>
2011-12-16Better error/eof detection in aioSteve Bennett1-12/+28
On cygwin, ECONNRESET can happen when the other end closes the connection. Treat it like EOF. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-12-13aio: Fix a compile problem for JIM_ANSICSteve Bennett1-0/+2
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-07Allow building with MSVC on windowsSteve Bennett1-3/+6
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-07Remove use of designated initialisersSteve Bennett1-98/+116
For better compatibility c89 compatibility. Also simplify jim-subcmd. Remove -usage and command descriptions. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-01Fix a bug where std* handles did not get KEEPOPENSteve Bennett1-34/+22
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-09-24Restucture jim-aio for less duplication of codeSteve Bennett1-96/+72
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-09-24Simplify and minimise aio getsSteve Bennett1-24/+18
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-09-12Remove all trailing whitespace in sourceSteve Bennett1-9/+9
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-09-12Trim the size of the boostrap jimsh sourceSteve Bennett1-10/+10
By removing comments and some large blocks of unnecessary code Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-09-12No aio listen if JIM_ANSICSteve Bennett1-24/+23
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-09-06Add support for aio listenSteve Bennett1-0/+24
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-07-22Help Jim Tcl build on HaikuSteve Bennett1-1/+1
Don't use -Werror Prefer user CFLAGS over default options Haiku needs -lnetwork for networking functions Haiku does not have -lm Haiku does not have SIGIO Silence some warnings Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-06-28Fix support for 64-bit mingwSteve Bennett1-1/+3
- Check for mkdir with one arg at configure time - mingw can't really do select(), so support only time events in eventloop - Declare dlerror() to be compatible with mingw Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-06-22aio: Ignore error indication on eofSteve Bennett1-5/+8
Reading from a pipe can set both ferror() and feof(). In this case, feof() takes precedence. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-06-10Add aio support for bufferingSteve Bennett1-0/+42
And fconfigure for Tcl compatibility Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-06-03Some systems don't have FD_CLOEXECSteve Bennett1-0/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-06-03Don't set FD_CLOEXEC on standard channelsSteve Bennett1-1/+3
stdio, stdout, stderr Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-06-01Use a union for Jim_Cmd fieldsSteve Bennett1-2/+2
There is no overlap between proc command fields and native command fields, so overlap them with a union. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-06-01Add Jim_String() macroSteve Bennett1-6/+6
It is very common to get the string value without the length. Jim_String() is a macro which does that. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-05-27Opened filehandles should be marked FD_CLOEXECSteve Bennett1-0/+4
This avoids them being inherited by child processes. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-01-24Use snprintf() to avoid buffer overflowSteve Bennett1-3/+3
The only real potential overflow is parsing a bogus unix domain socket path. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-24Remove the bio extension and add 'copyto' to aio.Steve Bennett1-0/+51
The bio extension is a hangover from TinyTcl. Since Jim supports binary strings, there isn't much need for it except for 'bio copy'. So move this to aio as 'copyto' and implement 'file copy' in terms of it. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-09Allow jim to be used as an autoconf subdirSteve Bennett1-0/+1
Ensure that no public headers include the autoconf header, jimautoconf.h, as it leads to problems with redefined symbols. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-30Fix segfault with unix domain socketsSteve Bennett1-4/+4
Path argument was not being set. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-30Add aio '$handle filename'Steve Bennett1-0/+12
Retrieves the original filename Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Licence wording updates.Steve Bennett1-2/+0
Per v0.51, don't refer to the FreeBSD licence Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Portability fixesSteve Bennett1-44/+82
Especially for eCos, mingw32 and cygwin Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Implement Tcl I/O wrappers in TclSteve Bennett1-110/+17
This allows 'rename' etc. to work correctly and is smaller, simpler code Also, read -nonewline is mutually exclusive with 'numChars' Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Ensure that Tcl extensions can be built-in or externalSteve Bennett1-0/+3
All C extensions must call Jim_PackageProvide() make-c-ext ensures that Tcl extensions call Jim_PackageProvide() if compiled in. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15eventloop improvements and enhancementsSteve Bennett1-1/+1
Move Jim_EvalObjBackground() out of the core to eventloop Time events are now kept and triggered in time order Time handlers are removed before execution Add 'update' Add 'after info' and 'after idle' Include time events in the return from Jim_ProcessEvents() Add Tcl eventloop tests Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Make sure all static data is marked read-onlySteve Bennett1-1/+1
This reduces the size of the non-shared data segment Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Implement open "|..."Steve Bennett1-17/+17
Uses a Tcl wrapper, popen, from tclcompat Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Reduce excessive stack usageSteve Bennett1-3/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix some eventloop problemsSteve Bennett1-48/+18
File handlers now pass through the error code and the handler is deleted on error. If there is nothing to do, vwait returns. If bgerror doesn't exist, print the original error to stderr. Also remove the 'eof' event handler since it isn't needed. Can just call [eof $f]. This also fixes source locations within 'readable' scripts. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15fh error not cleared after signalSteve Bennett1-5/+6
Use clearerr() after a read fails to avoid repeated failures after a signal. Also, dont' treat EINTR as an error in gets. And remove some leftover perror() calls. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15aio recvfrom was not null terminating the resultSteve Bennett1-0/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Add basic ipv6 support to JimSteve Bennett1-76/+241
Use -ipv6 to signify that ipv6 should be used Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Clean up the indentation messSteve Bennett1-195/+213
Use 'indent'. Not perfect, but at least consistent. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improvements to jim configureSteve Bennett1-124/+149
Create and use config.h Check for backtrace, fork, vfork, syslog, regcomp and others Disable extensions which require missing functions/features Check for one arg vs. two arg mkdir() Distinguish between mingw and native windows The aio extension has reduced functionality for ANSI C only Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Make udp sockets usefulSteve Bennett1-19/+103
Separate socket types: udp client and udp server Allow client sockets to 'connect' to an address Allow server sockets to 'bind' to an address Add support for 'sendto' and 'recvfrom' Add socket client and server examples Document new udp sockets Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Documentation, build system updatesSteve Bennett1-3/+3
Document reference-related commands *: ref, getref, setref, finalize, lambda were missing Build system updates *: Add check for long long to configure *: Change -Dwith_jim_ext_... to -Djim_ext_... *: Fix jim-eventloop when compiling with no long long
2010-10-15Add Jim_SetResultFormatted() for simplied messagesSteve Bennett1-3/+1
Makes creating error messages much simpler Also convert a couple of long if/else to switch Also some error message improvements Also fix some memory leaks
2010-10-15Various general fixes and cleanupsSteve Bennett1-7/+3
Add lsearch -command, update case to use lsearch Rename tcl6.tcl to tclcompat.tcl Remove // style comments Expand some tabs to spaces Fix some compiler warnings Remove some unused functions Don't close fd=-1 in exec
2010-10-15Implement 'socket pipe'Steve Bennett1-36/+85
------------------------------------------------------------------------
2010-10-15Bug fixes, documentation updatesSteve Bennett1-2/+6
jimsh - retry on EINTR from fgets() Fix 0 -> NULL for 64 bit systems Fix overlapping memcpy Fix jim array dereferencing bug *: Counting of parentheses was incorrect with nested array references *: The result for array dereference wasn't being used properly Add os.uptime command Documentation: autogenerated command index Fix gets when last line has no newline
2010-10-15aio fixesSteve Bennett1-33/+65
Fix argument checking/rearrangement in Tcl I/O compat Better aio error messages