newns() (called by auth_chuid()) already prepares the
environment variables and puts us in a sane working
directory (as specified by the namespace file).
on amd64, the text segment is aligned and padded to
2MB, but segment granularity is 4K which can give
us page faults that are beyond the highest file
offset. this is perfectly valid, but was not handled
correctly in pio().
use two per process memory slots, one for the
pid and one for the fd instead of a global table
avoiding the case when the table gets full.
instead of calling pread() on the cached fd
(dangerous as it has side effects when the
fd was not closed), we check if the cached fd
is still good using fd2path() when called
the first time in this process.
theres big performance regression with this using
cwfs. cwfs calls time() to update atime on every
read/write which now causes walks on /dev.
reverting to the previous version for now. in the
long run, we'll use new _nsec() syscall but this
has to wait for a later release once new kernels
are established.
trackers do like the new default Mozilla/5.0 (compatible)
user agent. so force useragent to hjdicks and give option
to override it in case trackers get even more clever in
the future.
in dhcpwatch, the sleep time "secs" could become
zero potentially freezing the lease time.
give up when in Sinit state in dhcpquery() as this
is a terminal state.
from the specification:
software may reset the entire HBA by setting GHC.HR to '1'.
When software sets the GHC.HR bit to '1', the HBA shall perform
an internal reset action. The bit shall be cleared to '0'
by the HBA when the reset is complete.
sites like google return the wrong characterset when
they do not recognize the user-agent. so setting default
user agent to something thats likely to pass these
idiotic browser tests.
> warning: a.c:9 useless or misleading comparison: UINT < 0
the error can be observed by compiling the following code
with warnings enabled:
#include <u.h>
#include <libc.h>
uint r;
void
main(int argc, char *argv[])
{
int r;
if(r < 0){
exits(0);
}
}
the offending code in the compiler is:
- if(l->op == ONAME && l->sym->type){
- lt = l->sym->type;
- if(lt->etype == TARRAY)
- lt = lt->link;
- }
compiler handles scope by overwritin and reverting
symbols while parsing. in the ccom phase, the nodes symbol
(n->sym) is not in the right scope and we wrongly think r
is uint instead of int.
it is not clear to me what this code tried to accomplish in
the first place nor could anyone answer me this question.
the risk is small as this change doesnt affect the compiled
program, only the warning, so removing the offending code.