Age | Commit message (Collapse) | Author |
|
9front has several tests scattered throughout the source,
as well as more tests in an external 'regress' repository.
Many of these tests are broken, because there is no easy
way to build and track all of them.
This pulls in several tests from different sources, deletes
the broken tests, tests with missing data, and adds a single
command that can be run from the root of the src directory
to test our system.
The hope is that as we develop new code, we add more tests,
and eventually start running the tests on every commit.
Please enter the commit message for your changes. Lines starting
|
|
mkstemp uses mktemp, which is only declared
when including files with _BSD_SOURCE, so
define _BSD_SOURCE before including the headers
|
|
|
|
There does not seem to be a good reason for this. The "bind" command
has no practical consequence.
|
|
Ports are filtered through "htons" which returns an "unsigned short".
|
|
Despite what the man pages say, local addresses can actually be set so
do that.
|
|
"port >= 0" is always true, because the port always gets filtered
through "htons" which returns "unsigned short", so we can just drop
the "else" branch here.
Anyway "announce 0" works fine with the Plan9 API, there is not need
for "announce *" here.
|
|
Despite the documentation, "bind *" is invalid and gives the error
"bad numeric port" in devip.c:setladdrport.
"bind 0" OTOH is actually supported fine in the Plan9 API and has the
right sematics.
|
|
|
|
The new rc's exit status will be '' for a successfull
pipeline execution instead of '|'.
This is a bit too tightly coupled, so just use if()
statement instead, handling this in a portable way.
|
|
Use O_EXCL and make the file descriptor writeable. This is more
usefull and it conforms to Single Unix and other specs.
|
|
|
|
this fixes the libsec build under ape.
|
|
Fd2path is a useful call for the netsurf plan9 frontend,
so we should expose it.
|
|
The arm assembler supports movw to handle
getfcr and setfcr now, no need to hack it
with macros; sync from plan9 libc.
|
|
|
|
We removed the wrong file. Put it back.
|
|
|
|
Apply changeset 2880:cab2b9d13a73 to ape's fmod() implementation.
Remove the unused math/fmod.c copy.
|
|
When _startbuf is invoked, it would crash on the second invocation
if creating a mux segment failed. This is because the first attempt
would assign the return value -1 to the global mux variable, and
the second attempt would notice that the global mux was not nil,
and would attempt to use it.
This change only assigns to the global variable if the allocation
of the segment was a success.
While we're here, we should also check the return of the rfork call.
|
|
|
|
Provide a central function to change the user id
of the calling process.
This is mostly used by programs to become the none
user, followed by a call to newns().
|
|
The devcons driver is really the wrong place to
serve per process information.
|
|
Using strlen in strndup will walk past the first
n bytes up to the terminator, which may not be
present. This is not what we want.
While we're here, do some cleanups.
|
|
strndup is part of POSIX.1, so APE should provide it.
This patch adds it, so need to patch it out of fewer
programs going forward.
|
|
Our ctype.h mistakenly ommitted isblank. Add it in.
While we're here, the make the 'isfoo()' functions
are broken: they're offsetting into the array, and
don't work with negative character values.
Sync the function bodies with the macros, and make
them produce correct results.
|
|
ape cp, mv, and cc build with ?c, not pcc
ape cp and mv just ignore one or two extra flags,
instead of providing posix compatibility
it's better to fail then do nothing
remove cp.c and mv.c
move cc.c to /sys/src/ape/9src so it doesn't
need its own mkfile rule
|
|
|
|
|
|
This adds the mkfiles and plumb.h to ape,
similar to how libdraw is made available.
This is used for ports such as netsurf.
|
|
|
|
This got broken in d8e877a89dae, where we returned 0 on the
first mismatch; we want to return 0 only when we consumed no
characters.
|
|
plan9 code (thanks jamos)
this fixes etimer() from ape built libdraw as posix sleep() uses
seconds while plan9 uses miliseconds.
|
|
We're missing type flags for:
hh: char
ll: vlong
z: size_t
t: ptrdiff_t
j: intmax_t
The lack of '%lld' was causing us to fail when parsing
timezone files. This brings us in line with the specifiers
in the C99 standard, section 7.19.6.2p11
|
|
When a match() fails, we need to unget the character we
tried to match against, rather than leaving it consumed.
Also, we can't break out of a conversion before we reach
the end of a format string, because things like the '%n'
conversion do not consume anything, and should still be
handled.
|
|
We used to have a padding int in the structure
after the next pointer, to align it to 16 bytes.
On 64 bit architectures, the pointer was already
8 bits, so the padding misaligned things to 20
bytes.
This fixes it so that we're explcit about the
data alignment we want, instead of hoping that
the various sizes line up.
|
|
manpage
|
|
|
|
It's been 20 years since c99 came out. By now, if code
hasn't been fixed, it's not going to be. Requiring this
define just confuses porters.
|
|
|
|
this change allows one to drop library directories (like
freetype) into /sys/src/ape/lib/ and have them built without
having to change the mkfile.
|
|
|
|
q
|
|
cases
handle empty filename, dot and dotdot. handle mismatching from/to directory/file
type. cleanup destination file on error. error when attempting to copy non-empty
directories.
little test program:
#include <unistd.h>
#include <stdio.h>
int
main(int argc, char *argv[])
{
if(argc != 3){
fprintf(stderr, "usage: %s old new\n", argv[0]);
return 1;
}
if(rename(argv[1], argv[2])){
perror("rename");
return 1;
}
return 0;
}
|
|
new implementation gets stuck in a infinite loop. backing
this out for now.
|
|
For ape, we never enabled warnings in cflags.
Turning it on brings up a lot of warnings. Most are noise,
but a few caught unused variables and trunctaions of pointers.
to smaller integers (int, long).
A few warnings remain.
|
|
|
|
|
|
|
|
just a first approximation, uses unaligned 8 byte loads and stores.
MOVP not yet implemented by the linker. no ZVA cache magic yet.
|