aboutsummaryrefslogtreecommitdiff
path: root/jim-posix.c
AgeCommit message (Collapse)AuthorFilesLines
2022-08-20bootstrap jimsh: assume fork() is available on posix platformsSteve Bennett1-0/+4
There are very few posix platforms where fork isn't available. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-01-10package: add ABI version checkingSteve Bennett1-3/+1
jim.h now includes JIM_ABI_VERSION that should be incremented whenever the ABI changes. Then all loadable modules should call Jim_CheckAbiVersion() to make sure they are loaded against the correct version. Add Jim_PackageProvideCheck() that does both Jim_CheckAbiVersion() and Jim_PackageProvide() to simplify the implementation of loadable extensions. Also rename the "big" sqlite3 extension to just sqlite to avoid a naming conflict with the smaller jim-sqlite3 extension. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-10-17signal, exec, wait, pid: improvements, especially to execSteve Bennett1-96/+0
- fix popen [open "|pipeline ..."] to return meaningful status in close (but note that stderr is not captured) - popen pipelines can now be used as the target of exec redirection - overally improvements to exec on windows. Now crt file descriptors are used throughout - add support for [pid], [wait] and popen on windows - os.wait is now wait, and integrates with [exec ... &] to be able to wait for running background tasks - [socket pipe] is now also [pipe] and is supported on windows - [file tempfile] is supported on windows - move duplicated code between jim-aio.c and jim-exec.c to jimiocompat.c - Fix [exec] on windows to match unix semantics wrt sharing the parent stream unless redirected rather than using /dev/null - On windows redirect to or from /dev/null is automatically converted to NUL: - If signal support is disabled, implement a minimal Jim_SignalId() for exec and wait - aio now supports getfd, to return the underlying file descriptor. This is used by exec to support redirection, and allows popen channels to support exec redirection. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-04-23os.gethostname: avoid mem leak on gethostname failureSteve Bennett1-0/+1
Courtesy of coverity Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-24Create build-jim-ext for building extensionsSteve Bennett1-1/+1
Simplifies the process of building loadable extensions Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-10-21Update source files to reflect FreeBSD licenceSteve Bennett1-16/+30
Some files still indicated the older Apache licence. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-09-12Remove all trailing whitespace in sourceSteve Bennett1-4/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-08-18Fix build on Solaris (gcc)Steve Bennett1-2/+2
inet_ntop needs -lnsl on Solaris Solaris has sysinfo, but no uptime Link flags need to be a bit different Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-12-15Use vfork() instead of fork() in [exec]Steve Bennett1-1/+1
This allows systems with vfork() but not fork() to have a full exec implementation, including constructs such as 2>@1 and background exec with & Also remove the --disable-fork option. It doesn't really make sense now since exec uses vfork 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-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-15autoconf improvementsSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Reduce excessive stack usageSteve Bennett1-4/+8
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Clean up the indentation messSteve Bennett1-12/+9
Use 'indent'. Not perfect, but at least consistent. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improvements to jim configureSteve Bennett1-9/+8
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-15Fix some build problems and add lost featuresSteve Bennett1-1/+1
Add some missing files needed for autoconf Make jim build standalone and without host jimsh Use (FILE *) for eventloop file handle Don't expect to support dynlib if no mmu Re-add nvp and win32 support (untested) Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Add Jim_SetResultFormatted() for simplied messagesSteve Bennett1-1/+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-15Bug fixes, documentation updatesSteve Bennett1-0/+26
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-15exec fixes, add os.waitSteve Bennett1-2/+86
Ensure that exec returns an error if appropriate Background exec returns a list of pids Need to close error filedescriptor Add os.wait
2010-10-15Enhance exec, bioSteve Bennett1-0/+5
Support @filehandle syntax Support for nommu Disable os.fork for nommu Remove trailing newline No need for binary escaping in bio module ------------------------------------------------------------------------
2010-10-15Implement some new featuresSteve Bennett1-0/+12
Implement 'lreplace' Implement 'string last' Implement 'pid' Implement 'info procs' Implement 'info script' Implement 'info patchlevel' as an alias for 'info version' Implement syslog extensions for jim Fix return code display in jim-interactive.c Make jim more compatible if JIM_TCL_COMPAT is set *: Use tcl_interactive rather than jim_interactive *: Use auto_path rather than jim_libpath Add "." to the lib search path, not "./" Fix a couple of files with CRLF line endings
2010-10-15Lots of improvementsSteve Bennett1-294/+0
jim --- Add a unique id facility to jim (Jim_GetId()) Remove unused jim_vasprintf(), Jim_AppendString_sprintf() Remove duplicate output in Jim_Panic() Add support for catch -signal aio --- Use this for aio handles aio automatically creates stdin, stdout and stderr channels Jim_AioFilehandle() returns the 'FILE *' filehandle for a channel If JIM_TCL_COMPAT is set, create top level open, close, read, puts, etc. load ---- load core command split out into jim-load.c package ------- package core command split out into jim-package.c added 'package list' posix ----- Remove os.sleep, os.usleep, os.sethostname, os.signal, pit, Jpit Most of these are in 'signal'
2010-10-15Make static extensions buildSteve Bennett1-1/+1
Also clean up some white space
2010-10-15Strip out unneeded junk from JimSteve Bennett1-6/+22
Nvp, getopt, move interactive processing to jim-interactive.c
2010-10-15Cutover to new workware fork of Jim TclSteve Bennett1-24/+13
Note that this commit removes some files and undoes some commits which will be reapplied later. This is the easiest way to switch across. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-02-01Bring corrected license as mentioned in freebsd/...Wojciech A. Koszek1-13/+24
Remove "FreeBSD license" statements, since it's not a correct term I believe. Small cleanup while being here.
2010-02-01Revert "Bring correct license -- I think freebsd/ directory has an agreements"Wojciech A. Koszek1-24/+13
This reverts commit 1e2fdd7d9e877fbe2c88a4c32f098ce1e575dc1d.
2010-02-01Bring correct license -- I think freebsd/ directory has an agreementsWojciech A. Koszek1-13/+24
for relicensing all files within Jim project. "FreeBSD license" isn't correct term, so basically remove it. Try to make the whole place consistent.
2008-07-14 * signals ( not complete , no eventscripts yet ) sleep and usleepoharboe1-0/+245
[pit] point in time and [jpit] julian point in time.
2008-06-16 * retire CVS keyword expansion. Plays havoc with patches.oharboe1-2/+0
2005-03-31Implemented the C API "background" for the packages system of Jim.antirez1-2/+4
2005-03-05delProc callback added to Jim_CreateCommand().antirez1-6/+6
Core commands handling updated to respect the new sematic.
2005-03-05extern int errno declaration removed from the posix extension.antirez1-3/+1
2005-03-04JIM_NOTUSED moved after var declarations blocks.antirez1-2/+2
2005-03-04$id: ..$ strings addedantirez1-0/+21
2005-03-04Added JIM_NOTUSED macro. Macro used where appropriate.antirez1-1/+1
2005-03-03Fixed a minor typo introduced with const-safeness patch.antirez1-6/+9
2005-03-02shell and library splitted. Now jim.c contains only theantirez1-0/+1
language implementation, while the shell is into jimsh.c, that is actually the first example of embedder of Jim. Important changes in jim.h to make Jim play well with extensions/embedders at the same time, and to deal with multiple files. Extensions now must define JIM_EXTENSION before to include jim.h, embedders must define JIM_EMBEDDED before to include jim.h.
2005-03-02removed JIM_EXTENSION define from extensions. Is no longerantirez1-2/+0
useful because only the core has to defile __JIM_CORE__. Added ctype.h in jim-win32com.c.
2005-03-01Indentation style changed to the new Jim standardantirez1-71/+71
4 spaces. No tabs used at all.
2005-02-27aritymin/aritymax information no longer used for C-coded commands.antirez1-5/+5
API changed accordingly.
2005-02-26Initial revisionantirez1-0/+112