The fchdir() function is equivalent to chdir() except that the
directory that is to be the new current working directory is
specified by a file descriptor.
`AK::String` can now be reversed via AK::String::reverse(). This makes
life a lot easier for functions like `itoa()`, where the output
ends up being backwards. Very much not like the normal STL
(which requires an `std::reverse` object) way of doing things.
A call to reverse returns a new `AK::String` so as to not upset any
of the possible references to the same `StringImpl` shared between
Strings.
MAXPATHLEN defines the longest permissable path length after expanding
symbolic links. It is used to allocate a temporary buffer from the buffer
pool in which to do the name expansion, hence should be a power of two.
On UNIX MAXPATHLEN has the same size as PATH_MAX.
After some very confused debugging, I discovered that GNU make has a
main() function with this signature:
int main(int argc, char** argv, char** envp)
Apparently this is a non-standard but widely supported thing, so let's
do the same in Serenity so make works as expected.
This fixes an issue where you had to do "make PATH=..." instead of make
just picking up PATH from the environment. :^)
I don't know what's really right or wrong here. It seems fine to also
include the directories in the total byte count, and it makes it a bit
easier to stay consistent when adding up size numbers elsewhere.
RPC clients now send JSON-encoded requests to the RPC server.
The connection also stays alive instead of disconnecting automatically
after the initial CObject graph dump.
JSON payloads are preceded by a single host-order encoded 32-bit int
containing the length of the payload.
So far, we have three RPC commands:
- Identify
- GetAllObjects
- Disconnect
We'll be adding more of these as we go along. :^)
Both overloads should know how to set up a notifier callback in case
we get EINPROGRESS from connect().
It might be even better to merge the connect() overloads into a single
function..
We were returning a zero-length ByteBuffer in some cases. We should be
consistent about this and always return a null ByteBuffer if nothing
was read at all.
Also added some assertions to DirectoryEntry in case someone tries to
instantiate them with names that would overflow the name buffer.
DirectoryEntry is a crappy data structure, and the name buffer is also
crappy. Added a FIXME about replacing it with something nicer.
Before this patch, the DirectoryEntry::name buffer would overflow if
you did "touch extremely-long-file-name". Duh.
Fixes#538.
Okay, here's something we've all been waiting for. A DOOM port :^)
It's based on the "doomgeneric" port and doesn't have sound support at
the moment, but it does let you play DOOM on Serenity.
Note that you have to provide DOOM1.WAD yourself.
Fixes#33.
Due to the changes in signal handling m_kernel_stack_for_signal_handler_region
and m_signal_stack_user_region are no longer necessary, and so, have been
removed. I've also removed the similarly reduntant m_tss_to_resume_kernel.
The old implementation tried to move forward as long as the current
byte looks like a UTF-8 character continuation byte (has its two
most significant bits set to 10). This is correct as long as we assume
the string is actually valid UTF-8, which we do (we also have a separate
method that can check whether it is the case).
We can't, however, assume that the data after the end of our string
is also valid UTF-8 (in fact, we're not even allowed to look at data
outside out string, but it happens to a valid memory region most of
the time). If the byte after the end of our string also has its most
significant bits set to 10, we would move one byte forward, and then
fail the m_length > 0 assertion.
One way to fix this would be to add a length check inside the loop
condition. The other one, implemented in this commit, is to reimplement
the whole function in terms of decode_first_byte(), which gives us
the length as encoded in the first byte. This also brings it more
in line with the other functions around it that do UTF-8 decoding.