Commit graph

132 commits

Author SHA1 Message Date
cinap_lenrek
5e37087451 ape: add internal _NSEC() function and make gettimeofday() use it 2016-04-10 02:52:31 +02:00
cinap_lenrek
6a651b42ac ape/stdio: %z format is VLONG on amd64 2016-01-07 19:20:30 +01:00
cinap_lenrek
4308f6e7e6 ape/fmt: %p and %z format for amd64 2016-01-07 19:04:12 +01:00
cinap_lenrek
1dd7f0893b ape: add missing _subv() function to 386/vlop.s 2015-10-04 20:16:41 +02:00
cinap_lenrek
9e3ef5c777 ape: add machine specific code for spim 2015-10-04 19:50:24 +02:00
cinap_lenrek
d2af6b40af libc: add _uv2d()/uv2f() and _vas*d() functions to vlrt.c
on 32 bit archs, implement 64 bit vasop with floatingpoint right hand side.
also added is uvlong->double conversion function.
2015-10-04 19:49:02 +02:00
mischief
8737864294 ape: add badrect object into ape libdraw 2015-09-25 16:44:25 -07:00
cinap_lenrek
4b6506cb57 ape: fix build for objtype=spim 2015-08-08 08:17:54 +02:00
cinap_lenrek
63759d2efb ape: implement altzone for tzset() 2015-08-04 02:01:41 +02:00
cinap_lenrek
333812ca38 ape: fix mktime() again 2015-08-04 02:00:37 +02:00
cinap_lenrek
cd92790c50 ape: port libc smp tas() for arm 2015-07-07 19:53:26 +02:00
ftrvxmtrx
a25758dce7 fix strncmp/memcmp used with a wrong number 2015-06-11 22:13:55 +02:00
cinap_lenrek
dfdc52ea7a libc: use Runemax instead of hardcoded 0x65536 for fmtchar check (thanks qrstuv) 2015-05-17 07:02:44 +02:00
cinap_lenrek
1cff9ab4e8 ape: fix main9 for mips 2015-03-25 13:56:04 +01:00
cinap_lenrek
cabf90e4ee ape: fix lockinit() for mips 2015-03-25 08:33:11 +01:00
cinap_lenrek
3889ada959 ape: silence compiler "no return at end of function" for mips lock.c 2015-03-18 19:30:12 +01:00
cinap_lenrek
2ab042f11e getfcr: change getfcr/setfcr to use VFP 2014-12-25 17:44:49 +01:00
cinap_lenrek
a5b0b6ba2c ape: add fprint %z format (thanks Ori_B) 2014-12-22 09:18:18 +01:00
cinap_lenrek
fafc17b049 expr: fix missing type declarations for match(), which broke on amd64 as pointers dont fit into a long 2014-07-12 03:02:21 +02:00
cinap_lenrek
ca35949c20 ape/stdio: set errno to EMFILE when running out of streams 2014-05-29 00:34:47 +02:00
cinap_lenrek
2c5c784255 prof: properly save and restore RARG for amd64
amd64 passes first argument in RARG (BP) register
which has the be preserved duing _profin() and
_profout() calls. to handle this we introduce
_saveret() and _savearg(). _saveret() returns
AX, _savearg() returns RARG (BP). for archs other
and amd64, _saveret() and _savearg() are the
same function, doing nothing.

restoing works with dummy function:

uintptr
_restore(uintptr, uintptr ret)
{
	return ret;
}

...

ret = _saveret();
arg = _savearg();
...
return _restore(arg, ret);

as we pass arg as the first argument, RARG (BP) is
restored.
2014-02-17 13:25:24 +01:00
cinap_lenrek
ed9e9f98e9 libc and ape support for amd64 2014-02-01 10:31:41 +01:00
cinap_lenrek
43ae553195 ape: remove local copy of memccpy() 2014-01-20 00:05:19 +01:00
cinap_lenrek
7143b286b7 ape: move strdup() from libbsd to libap (from sources)
including <string.h> should be enougth to make strdup()
available.
2013-12-28 05:14:10 +01:00
mischief
61269254d0 synchronize ape's vfprintf with libstdio
in ape's vfprintf we don't check if the file we're writing is actually a string buffer, resulting in a return of -1, when we should actually return the number of bytes that would be written.
2013-11-06 11:22:15 -08:00
cinap_lenrek
4a9f900726 mkfiles: do not rely on path containing the . element
when executing generated binaries and helper scripts,
always execute them as ./name instead of relying that
path contsins the dot.
2013-10-26 20:22:01 +02:00
cinap_lenrek
cdc2c30e99 reverting semaphore lock changes from sources (r41ccd6d221da, rb28756e5ba29)
semaphore locks have much higher overhead than initially presented
in the "Semaphores in Plan9" paper. until the reason for it has been
found out i will revert the changes.
2013-09-26 22:24:31 +02:00
cinap_lenrek
f811708ffc ape: change tas/sleep locks to cas/semacquire/semrelease locks (from sources) 2013-09-21 19:55:52 +02:00
cinap_lenrek
b38d197995 ape: fix _main stack setup for arm (_privates and _errnoloc was inside argv) 2013-06-08 23:53:28 +02:00
cinap_lenrek
389d6a1054 ape: change types from unsigned long to void* for rendezvous() and segattach()/segbrk() (erik), use uniqueue rendezvous tags for _buf and listen 2013-05-11 18:34:40 +02:00
ppatience0
36287edc88 ape: remove unused variables 2013-05-06 20:51:18 -04:00
ppatience0
517c0feaca ape: fix uninitialized variable bug in getfields() 2013-05-06 20:24:19 -04:00
ppatience0
a1bc7c76ba merge 2013-05-06 19:37:51 -04:00
ppatience0
5ac6088b96 access: unused variable 2013-05-06 19:35:03 -04:00
cinap_lenrek
9de8d61fe6 ape: get rid of fixed MUXADDR for buffered i/o
instead of trying to resize the segment (which will not work when
the kernel picks the address as it will allocate right before
the base of the topmost segment), we create the mux segment with the
maximum size needed (arround 1.4MB) for OPEN_MAX filedescriptors.

buf slots will be reused and slots get demand paged once used.
2013-05-03 19:34:48 +02:00
cinap_lenrek
d1905d8063 ape: remove unused variables from _buf (from erik qunastros _bufupd patch) 2013-05-03 13:46:27 +02:00
cinap_lenrek
decade55c6 frexp: handle NaN values (from sources) 2013-05-01 16:44:04 +02:00
cinap_lenrek
4ae7954547 ape: inet_ntop() print v4 mapped addresses in v6 as dotted quad 2013-04-05 14:09:41 +02:00
cinap_lenrek
d645d4d81b ape: inet_pton() parse dotted address to IPv4 mapped addresses for AF_INET6 2013-04-02 03:48:10 +02:00
cinap_lenrek
e8c1d0fe7c ape: check *alen before copying in getpeername(), getsockname() and accept()
*alen has to be initialized to the size of the buffer
by the caller, and we are supposed to put the real
size of the address in there, but not copy more than
the original *alen value (truncate).
2013-04-02 01:40:29 +02:00
cinap_lenrek
e8a0276090 ape: add inet_aton() 2013-04-01 19:16:18 +02:00
cinap_lenrek
b6dc4ba5a4 ape: initial IPv6 support, inet_pton()/inet_ntop(), getaddrinfo()/getnameinfo() 2013-03-31 18:52:45 +02:00
cinap_lenrek
c97a0268f3 ape: fix potential double close in socket() and protect rock chain with spinlock 2013-03-29 20:49:49 +01:00
cinap_lenrek
25f04a68a1 ape: threadsafe errno
store errno on the private process stack so its always per process
and not just per memory space. errno itself becomes a macro
dereferencing int *_errnoloc; which is initialized from main9.s
pointing to the private stack location.

various fixes in programs that just imported errno variable with
"extern int errno;" instead of including <errno.h>.
2013-03-11 18:57:22 +01:00
cinap_lenrek
631aef280d ape: fix thread race with close() and select()
in ape close(), do the real filedescriptor _CLOSE() *after* we cleared
the _fdinfo[] slot because once closed, we dont own the slot anymore and
another process doing open() can trash the slot. make sure open() retuns
fd < OPEN_MAX.

double check in _startbuf() holding mux->lock if the fd is already buffered
preveting running double copyprocs on a fd.

dont zero the mux->rwant/ewant bitmaps at the end of select() as we do not
hold the mix->lock.

in _closebuf() kill copyproc while holding the mux->lock to make sure the
copyproc isnt holding it at the time it is killed. run kill() multiple times
to make sure the proc is gone.
2013-03-11 01:16:34 +01:00
cinap_lenrek
d526ee0750 ape/malloc: make malloc and free threadsafe for python 2013-03-11 00:55:26 +01:00
cinap_lenrek
48b0c10681 ape/stdio: make fopen() quasi threadsafe for python
python uses processes sharing memory. it requires at least fopen() to
be called by multiple threads at once so we introduce _IO_newfile()
which allocates the FILE structure slot under a lock.
2013-03-11 00:48:35 +01:00
cinap_lenrek
530a2bc5e9 ape: check for invalid filedescriptors in select() 2013-03-10 18:35:07 +01:00
cinap_lenrek
8b72726549 ape: add PASS_MAX constant for getpass() to limits.h (from patch/ape-pass_max)
add PASS_MAX to limits.h for ape, and make getpass respect it. also increase the size of
the maximum passwords (we use long ones at work). Needed for native port of SVN (in progress).
2013-02-28 19:21:03 +01:00
ppatience0
f1727a6742 ape: fix bug in access() 2013-02-08 18:01:31 -05:00
cinap_lenrek
2de4e31f56 ape: fix getsockname() byte swaped ports (by yarikos)
APE's getsockname() returns port with bytes swapped (on 386).
2013-01-09 06:08:29 +01:00
cinap_lenrek
6cadd03bbe fix utf and rune handling in preparation for 32bit runes 2012-12-31 21:09:46 +01:00
cinap_lenrek
4ae38efc1c ape/mv: check if from path fits and error if too long 2012-12-04 06:06:28 +01:00
cinap_lenrek
2fcd19f16e ape: fix memory leak and path limit in unlink()
db1 was leaked, and newname could overflow. fixed.
2012-12-03 19:16:22 +01:00
cinap_lenrek
a16f5cd2a3 ape: forgot to set errno in access() for dir create fail 2012-12-03 18:54:56 +01:00
cinap_lenrek
4661934e31 ape: fix _grpmems(), access(), getppid(), cleanup
_grpmems() was broken tokenizing group list in place.
we have to copy it to status buffer before tokenizing.

dynamically alloc path for test file to check write
permission on directory and add pid to the name to
prevent races.

use _OPEN instead of ape open to read /dev/ppid in
getppid().

use mode enums instead of numeric constants for _OPEN()
and _CREATE().
2012-12-03 18:47:41 +01:00
cinap_lenrek
ee251568fb ape: putenv, add file :) 2012-12-03 06:47:01 +01:00
cinap_lenrek
84c930a078 ape: fix putenv()
writing /env in putenv() doesnt work. exec will create
new enviroment anyway. we have to modify environ array!
2012-12-03 06:44:30 +01:00
cinap_lenrek
eb9de925c6 ape: fix more bugs, use /env and /proc instead of #e and #p, cleanup
remove envname length limitation in _envsetup()
by using allocated buffer and use /env instead of #e

use /proc and getpid() instead of #p and #c in
readprocfdinit()

fix buffer overflow in execlp(), check if name
of failed exec starts with / . or is \0

make sure not to close our own filedescriptors
for FD_CLOEXEC in execve(), fix wrong length
check for flushing buffer to /env/_fdinfo.
fix error handling cases. copy the enviroment
before decoding \1 to \0 because the strings in
environ[] array might not be writable.

remove bogus close if we fail to open ppid file
in getppid() and use /dev/ppid instead of #c/ppid
2012-12-03 05:35:33 +01:00
cinap_lenrek
f3842de5fd ape: initialize _tos and use _tos->pid for getpid() 2012-12-03 05:22:21 +01:00
cinap_lenrek
45b498c027 ape: fix buffer overflow in _envsetup() 2012-12-02 12:32:23 +01:00
cinap_lenrek
be0301f458 calloc: check multiplication overflow 2012-08-19 10:50:39 +02:00
cinap_lenrek
84d1ef1463 ape/mkfile: work arround fake "command line arguments" rule matching 2012-08-08 21:36:42 +02:00
cinap_lenrek
4f33c88a51 import updated compilers from sources 2012-07-30 19:11:16 +02:00
cinap_lenrek
546cd2bea2 ape: fix symbol name collision for by renaming static timezone struct to tz 2011-06-04 21:44:21 +00:00
aiju
7a4e46d7ab fixed mktime bug 2011-06-03 13:06:28 +02:00
aiju
67daf453a7 fixed tzset(), hopefully hg timezone bug should be fixed now 2011-06-04 12:02:42 +02:00
aiju
6ab691048d added (unfinished) nanosleep to APE 2011-06-03 12:28:37 +00:00
taruti
f34231e16a Fix mkfile from prev commit 2011-05-23 14:01:15 +00:00
taruti
e124ba66c5 Add ape/cp + ape/mv 2011-05-23 13:55:05 +00:00
cinap_lenrek
3a78a07143 ape: fix fread/fwrite, python: disable bytecode dumps, inst: rename textonly to start and remove inst/gui, add sys/lib/rootbind, cisfd(8) manpage 2011-05-10 05:33:43 +00:00
aiju
16892e5e6c fixed fread 2011-05-09 14:49:41 +00:00
aiju
9f13a6a654 fixed fwrite (hopefully didn't break anything) 2011-05-09 14:42:01 +00:00
cinap_lenrek
b1955840c5 rename ape manpages so they dont get filtered out as object files 2011-05-04 06:19:09 +00:00
cinap_lenrek
6c1b421882 build ape/z before everything else (openssl) 2011-05-03 19:05:58 +00:00
cinap_lenrek
53e0e51cbb ape: fix broken chmod for directories. (makes hg work again) 2011-05-03 16:56:50 +00:00
cinap_lenrek
5976fdfe42 remove stuff 2011-05-03 15:16:20 +00:00
cinap_lenrek
3a742c699f add zlib, bzlib and openssl ape ports 2011-05-03 09:56:35 +00:00
cinap_lenrek
9d24a107a5 boot(8): changed tread to read, other: fix perms 2011-04-18 01:59:36 +00:00
cinap_lenrek
5e45406a0d fixing perms 2011-03-30 18:29:07 +00:00
Taru Karttunen
a9060cc06b Import sources from 2011-03-30 iso image - lib 2011-03-30 19:35:09 +03:00
Taru Karttunen
e5888a1ffd Import sources from 2011-03-30 iso image 2011-03-30 15:46:40 +03:00