Age | Commit message (Collapse) | Author |
|
|
|
This is a variant of bzero() that is guaranteed to not get optimized
away by the compiler. Useful for clearing out sensitive data.
|
|
|
|
When we hit the last token, make the saved pointer point to the null
terminator instead of to the next token. This ensures that the next
call to strtok_r() returns null as expected.
Found by running GCC in UE. :^)
|
|
Calling strerror() with a negative number should not access below the
error string array.
Found by running GCC in UE. :^)
|
|
If you try to do this (e.g "mv directory directory"), sys$rename() will
now fail with EDIRINTOSELF.
Dr. POSIX says we should return EINVAL for this, but a custom error
code allows us to print a much more helpful error message when this
problem occurs. :^)
|
|
Mostly in comments, but sprintf() now prints "August" instead of
"Auguest" so that's something.
|
|
Not used anywhere in Serenity currently, but required for OpenSSH.
|
|
|
|
|
|
strdup: Because the length is already known at the time of copying, there is
no need to use strcpy (which has to check every single byte, and thus tends
to be slower than memcpy).
strndup: If 'str' is not NUL-terminated, strndup used to run off into the
adjacent memory region. This can be fixed by using the proper strlen variant:
strnlen.
|
|
|
|
This commit adds an implementation of memmem, using the Bitap text
search algorithm for needles smaller than 32 bytes, and a naive loop
search for longer needles.
|
|
There's no great advantage to using MMX instructions here on modern
processors, since REP MOVSB/STOSB are optimized in microcode anyway
and tend to run much faster than MMX/SSE/AVX variants.
This also makes it much easier to implement high-level emulation of
memcpy/memset in UserspaceEmulator once we get there. :^)
|
|
|
|
As suggested by Joshua, this commit adds the 2-clause BSD license as a
comment block to the top of every source file.
For the first pass, I've just added myself for simplicity. I encourage
everyone to add themselves as copyright holders of any file they've
added or modified in some significant way. If I've added myself in
error somewhere, feel free to replace it with the appropriate copyright
holder instead.
Going forward, all new source files should include a license header.
|
|
|
|
|
|
Currently only Ext2FS and TmpFS supports InodeWatchers. We now fail
with ENOTSUPP if watch_file() is called on e.g ProcFS.
This fixes an issue with FileManager chewing up all the CPU when /proc
was opened. Watchers don't keep the watched Inode open, and when they
close, the watcher FD will EOF.
Since nothing else kept /proc open in FileManager, the watchers created
for it would EOF immediately, causing a refresh over and over.
Fixes #879.
|
|
|
|
|
|
|
|
Patch from Anonymous.
|
|
We had some kernel-specific gizmos in AK that should really just be in the
Kernel subdirectory instead. The only thing remaining after moving those
was mmx_memcpy() which I moved to the ARCH(i386)-specific section of
LibC/string.cpp.
|
|
We don't actually do any non-i386 builds at the moment, this is just gently
steering in a nice direction for the future. :^)
|
|
Things were getting a little crowded in the project root, so this patch
moves the Lib*/ directories into Libraries/.
|