Commit Graph

5 Commits

Author SHA1 Message Date
Xavier Delaruelle
452b3ffb25 lib: implement initStateUsergroups
Add function in libtclenvmodules to implement `initStateUsergroups` as a
Tcl command, which provides a more efficient way to retrieve current
groups of running process, rather forking to execute `id` external
binary.

Note that if current system does not support the `getgroups` system
call, only the primary group name of current user will be returned.
2020-07-16 21:53:51 +02:00
Xavier Delaruelle
11e6099aec lib: Implement initStateUsername
Add function in libtclenvmodules to implement `initStateUsername` as a
Tcl command, which provides a more efficient way to retrieve current
username, rather forking to execute `id` external binary.
2020-07-16 21:53:51 +02:00
Xavier Delaruelle
a5d0c0e3c5 lib: bump copyright year mention 2019-08-09 21:15:10 +02:00
Xavier Delaruelle
9b8e5981a7 Implement getFilesInDirectory in Tcl extension library
Add function in libtclenvmodules to implement getFilesInDirectory as a
command, which provides a more IO-optimized way than native Tcl commands
perform by avoiding specific additional queries to get hidden files like
.modulerc and .version. As a result 1 stat and 2 access syscalls are
saved per directory read.
2019-04-29 16:02:13 +02:00
Xavier Delaruelle
3c360a9937 Introduce Modules Tcl extension library
Introduce Modules Tcl extension library (written in C) to extend Tcl
language in order to provide more optimized I/O commands than native Tcl
commands do.

This library first provides a 'readFile' command which performs an open,
read, close of a given modulefile to fetch its content. Compared to the
Tcl native open, read, close commands it saves 1 ioctl + 1 fcntl + N
lstat system calls per modulefile.
2019-04-29 15:56:23 +02:00