82d076b51f6fe7c1cbd1f37414be36eaaa9b0e56 |
|
02-Jul-2015 |
Jeff Sharkey <jsharkey@android.com> |
Add getxattr/setxattr/removexattr syscalls. Bug: 20275572 Change-Id: I958056f757f095ad6278624e293a5583d9cee822
|
a8b7587c5001db3489c64ac1d16c254a683f76bd |
|
11-Mar-2015 |
Lorenzo Colitti <lorenzo@google.com> |
Add a version of sendto that takes a SocketAddress. Only the byte[] version for now. The ByteBuffer version will be added later. Bug: 19704592 Change-Id: I35c5f305b5828ff3315e42aae72aa4b01839e2fc
|
8f5b46d72e5c1b1b1dd4357580c4fb5a60e3f4de |
|
26-Jan-2015 |
Erik Kline <ek@google.com> |
Add support for netlink sockets and addresses. Additionally: - support bind and connect calls with SocketAddresses - getsockname and getpeername can return a NetlinkSocketAddress Developed in conjunction with: https://android-review.googlesource.com/135490 Bug: 18581716 Change-Id: I760a06cdb9bdb26c734fb02cf668a94de982e2b6
|
30c669166d86d0bd133edfb67909665fb41d29b6 |
|
16-Jan-2015 |
Narayan Kamath <narayan@google.com> |
Remove fcntlLong, use fcntlInt for F_SETFD instead. fcntlLong works too, but only because of the syscall conventions happen to place the lower 32 bits of our jlong in the right register. This change also gets rid of fcntlLong because there aren't any documented fcntl calls that take a 64 bit integer argument. Change-Id: I8d187d5b906195fc663675a07a5f116dcd210d16
|
c8d9ea662de6f4856b28907b4119087cfc5a44d2 |
|
16-Jan-2015 |
Narayan Kamath <narayan@google.com> |
Add fcntlInt. Hidden for now, for use from the frameworks. Change-Id: I30d95b28ecbc422aaa5bf28fb2f288c3ca026493
|
8f0f2ac7fcd8f366a78cc51181d065ab93385e46 |
|
17-Dec-2014 |
Elliott Hughes <enh@google.com> |
Add various system calls needed by the zygote. Bug: 18719692 Change-Id: I91a943369bc3b331e7e06e758f729b008c3c041c
|
d9f7e57f5d09b587d8c8d1bd42b895f7de8fbf54 |
|
09-Dec-2014 |
Narayan Kamath <narayan@google.com> |
Update ByteBuffer positions in Posix.* functions. Also add tests in libcore.io.OsTest and update (and simplify) callers that were updating the position themselves. bug: 18641009 (cherry picked from commit f3b61eaf1931ae8393e54202a717334a4971ebdf) Change-Id: I8a810b2dfde7c13278807381bdfe7f532a3481a0
|
0d8b5c3692c36837d22c4e7d9c4d7d95f6a10235 |
|
12-Dec-2014 |
Elliott Hughes <enh@google.com> |
Add pipe2 and O_CLOEXEC to the libcore POSIX API. @hide right now, but we should expose these at some point. Bug: 18719692 Change-Id: I0a73606cf089ed307d1ab2916a7df28b3c45aaf0
|
f3b61eaf1931ae8393e54202a717334a4971ebdf |
|
09-Dec-2014 |
Narayan Kamath <narayan@google.com> |
Update ByteBuffer positions in Posix.* functions. Also add tests in libcore.io.OsTest and update (and simplify) callers that were updating the position themselves. bug: 18641009 Change-Id: Ie0bbde767489eec1a6ef0158f2b14853d4612f18
|
99a0c82619a88c6aea038757cf14090f5d33afeb |
|
27-Nov-2014 |
Neil Fuller <nfuller@google.com> |
Fix crash in selector.wakeup() with closed selector Selector.wakeup() can throw an undeclared IOException (from native code). This is not compatible with the signature of wakeup(). In prior Android releases no exception is thrown in this case. This change reverts the behavior to the same as prior Android releases. Many thanks to diddysbestbud@ for the report. Bug: https://code.google.com/p/android/issues/detail?id=80785 Bug: 18548071 (cherry picked from commit 1791f6be1bd2733babb0c862ad8509f4c847b48f) Change-Id: I19ee879dcd783655d8a402e12855a5fa1f1eb90c
|
1791f6be1bd2733babb0c862ad8509f4c847b48f |
|
27-Nov-2014 |
Neil Fuller <nfuller@google.com> |
Fix crash in selector.wakeup() with closed selector Selector.wakeup() can throw an undeclared IOException (from native code). This is not compatible with the signature of wakeup(). In prior Android releases no exception is thrown in this case. This change reverts the behavior to the same as prior Android releases. Many thanks to diddysbestbud@ for the report. Bug: https://code.google.com/p/android/issues/detail?id=80785 Bug: 18548071 Change-Id: I5421e8a0ae1fdf2cde9cb635dae56b4fd02b6ac4
|
3e58734d651080009c9190c7062837fca5c7cf4e |
|
13-May-2014 |
Paul Jensen <pauljensen@google.com> |
Add support for network-specific host name resolution. For now all such support is hidden. Change-Id: I932f73158a8f6e3ccc36c319d138180dff2aa070
|
04428d61d7000e17ab21d08a1d672c34eb68f6e2 |
|
10-May-2014 |
Elliott Hughes <enh@google.com> |
Add android.system.Os.link for link(2). Bug: 14683762 Change-Id: Ieeba1d2d0c5e9c05e85c6ffbaeb5a7febc69238c
|
5215e4c0db7530519981f1e505e6db82401802f2 |
|
25-Apr-2014 |
Nick Kralevich <nnk@google.com> |
add prctl / PR_SET_NO_NEW_PRIVS Add java wrappers for prctl and PR_SET_NO_NEW_PRIVS. Change-Id: I649a755ea9354b0290b25292bc65901b1528c1d5
|
5d930cadc8f62aee5f18e7921296fe66a54f18ab |
|
24-Apr-2014 |
Elliott Hughes <enh@google.com> |
Groundwork towards making the Libcore.os functionality public. Change-Id: Ie700aa16d91fba53fc5eb2555829cb74d84b12ad
|
f0d40d662d9dfdb04215c718961765837d2cf00c |
|
11-Apr-2014 |
Neil Fuller <nfuller@google.com> |
libcore changes to support asynchronous close interruption Previously AsynchronousSocketCloseMonitor was used to handle socket interruption on close. To support the same for FileChannel it has been renamed to AsynchronousCloseMonitor. The Java class was already called this. FileInputStream, FileOutputStream, RandomAccessFile will now throw IOException if a connection is closed by another thread during read. Thread.interrupt() continues to have no effect on streams. FileChannel will now throw AsynchronousCloseException during reads and writes if the file is closed, per the documentation. FileChannel will now throw ClosedByInterruptException during reads and writes if the thread reading/writing is interrupted. Note: FileChannel.lock() will probably still not not throw AsynchronousCloseException, though it probably should. This change also has impact on external/conscrypt and frameworks/base. Change-Id: I37de3e7d1a005a73821221e6156d10b95c595d7a Bug: 13927110
|
df29508a7aa622f265aaebdc472eb7d679185ebb |
|
30-Jan-2014 |
Neil Fuller <nfuller@google.com> |
Implementation of MulticastChannel. Note: ProtocolFamily / StandardProtocolFamily / DatagramChannel.open(ProtocolFamily) have not been implemented. There is a related change to libnativehelper that must be merged at the same time to avoid build breakage. See https://android-review.googlesource.com/#/c/81371/ Bug: 12464155 Change-Id: I07fc049b429a2d373e9bd7b07149632f5cd69f9d
|
11f07d30d2e344b48f132ec6ed105d85423052c2 |
|
04-Feb-2014 |
Elliott Hughes <enh@google.com> |
Add posix_fallocate to Libcore.os. (The Java API takes longs for the off_t arguments, and uses posix_fallocate64 behind the scenes.) Bug: 5287571 Change-Id: I48566d8720c6b41ab42a402eeb322d054d2029ea
|
0b6b3e10459fc3a3f4dd280dab8d4a145f7bf2f0 |
|
01-Feb-2014 |
Elliott Hughes <enh@google.com> |
Move the hidden File.readlink into Libcore.os. Change-Id: Ia983909e62d3806027dff870f0148dd07c31bf01
|
069525a39125c203b658c805685b6045a7d4dfeb |
|
30-Jul-2013 |
Elliott Hughes <enh@google.com> |
Add gettid. Change-Id: Ie18095d696ebeb8f056fb7f5b7cfbc452cdf8206
|
721ceca2a52a3c27aa751476c8562e1e68088e15 |
|
09-Jul-2013 |
Elliott Hughes <enh@google.com> |
Switch libcore from statfs to statvfs. Change-Id: I5115b9203ce6b11c37c0eb41fbc84fa5962ce196
|
763f8ed6195707d0c30bfae1ca8a3bb886b746cc |
|
29-Mar-2013 |
Elliott Hughes <enh@google.com> |
Add strsignal(3) to Libcore.os. Bug: 8322568 Change-Id: Iab9a782181a663719b88f090f474b66d24b69258
|
482a3fc5635ac431b8a7476d7fe3397af4c2e8ec |
|
21-Mar-2013 |
Elliott Hughes <enh@google.com> |
Add support for Unix domain sockets. Bug: 6513075 Change-Id: I0b0166f59745ac8175b39d7796c093041b2df4fd
|
798f855f67b74d481346d9dc2293ba0eedd8daf9 |
|
05-Feb-2013 |
Nick Kralevich <nnk@google.com> |
Add support for Libcore.os.exec*() Add Libcore support for execv() and execve(). This allows java programs to execute other programs without having to write jni wrappers. Change-Id: I82ddc069b5812ebd40f06b7f65ce173d496e0597
|
039f7599559fd7e48c354b99dcb94ff391f53349 |
|
15-Dec-2012 |
Elliott Hughes <enh@google.com> |
Add tcsendbreak(3). Change-Id: I12821c1ef41100ee83a13fd79c14d9eb16b6adca
|
895a613aa2aec6aa6d03b29755cf2fea584909ad |
|
06-Nov-2012 |
Elliott Hughes <enh@google.com> |
Add setenv(3) and unsetenv(3) to Libcore.os. Change-Id: Ic1c667cda3203afecb3eb9b4183ec6a4013988cc
|
b2e6be1cc1d375ca2fc28ee1fdfc10c0adc2554d |
|
29-Sep-2012 |
Elliott Hughes <enh@google.com> |
Rewrite NIO Pipe to use socketpair(2). Our Pipe originally used socket(2) to create AF_INET/AF_INET6 sockets. This was clearly a bad idea. I rewrote it to use socketpair(2) and AF_UNIX, but this was before the big "expose POSIX" rewrite, so it required a bunch of hacks in the native code, so I went with pipe(2) instead. The trouble with pipe(2) is that we end up using FileChannel to implement the Pipe.SinkChannel and Pipe.SourceChannel, but the kernel won't wake a read(2) on a pipe if another thread calls close(2) on it, so we started failing interrupt tests. This (final?) rewrite is hopefully the best of all worlds: we don't have any INTERNET permission needs, the code is as simple as the pipe(2) code, and interruption works. Bug: 7084342 Bug: 2735373 Bug: http://code.google.com/p/android/issues/detail?id=9431 (cherry picked from commit 3218082325b6b8713a8ac15731482e3da86a7df9) Change-Id: Ib92cdf8c818f6bba1f00e191f1b624ce9e693754
|
c79d3ef4dcd25f0e264bf957861e2632da93e62d |
|
27-Sep-2012 |
Nick Kralevich <nnk@google.com> |
Posix_umask: throw IllegalArgumentException on malformed mask If we see an invalid umask, throw an IllegalArgumentException. This prevents a native crash when FORTIFY_SOURCE is enabled and the java umask method is used improperly. Change-Id: I21aae48500df5e7081b63601123dd40070b4ff05
|
3218082325b6b8713a8ac15731482e3da86a7df9 |
|
29-Sep-2012 |
Elliott Hughes <enh@google.com> |
Rewrite NIO Pipe to use socketpair(2). Our Pipe originally used socket(2) to create AF_INET/AF_INET6 sockets. This was clearly a bad idea. I rewrote it to use socketpair(2) and AF_UNIX, but this was before the big "expose POSIX" rewrite, so it required a bunch of hacks in the native code, so I went with pipe(2) instead. The trouble with pipe(2) is that we end up using FileChannel to implement the Pipe.SinkChannel and Pipe.SourceChannel, but the kernel won't wake a read(2) on a pipe if another thread calls close(2) on it, so we started failing interrupt tests. This (final?) rewrite is hopefully the best of all worlds: we don't have any INTERNET permission needs, the code is as simple as the pipe(2) code, and interruption works. Bug: 7084342 Bug: 2735373 Bug: http://code.google.com/p/android/issues/detail?id=9431 Change-Id: If3f052c9d3f5aa1c099f5a069ace9a8d6ce3ca3a
|
6c9b5377550a9649ed1532d1fcdfeba116c74ead |
|
21-Sep-2012 |
Elliott Hughes <enh@google.com> |
Add setsid. See "Monkey not handling SIGHUP signal" (https://android-review.googlesource.com/43053). Change-Id: Ib327702caefa8eb8d044723c270acfe4685c7551
|
bb5816aa1626eb2f6263bd21479600b114c8a1bd |
|
10-Jan-2012 |
Johan Redestig <johan.redestig@sonymobile.com> |
Make FileDescriptor.sync() work on ttys fsync on Linux fails on tty file descriptors. This change adds the capability to make sure all data was written to the terminal device descriptor to java.io.FileDescriptor.sync() implementation. Also fixed the return value from Posix_isatty. isatty returns 1 if an fd is a tty and 0 otherwise. Change-Id: I6cc65db83f523b4c31b67b48d7534e18af0989e8
|
44f7875f2985d7944c5afecc8394ad9f2219c806 |
|
16-Aug-2012 |
Elliott Hughes <enh@google.com> |
Add chown, fchmod, fchown, lchown, and umask. Bug: 6141031 Bug: 3107501 Change-Id: I3f514f615b397f57340066f26d43320fb3c219fa
|
26010ab930a2cee3bf10b9612cf070183c21228b |
|
24-Jul-2012 |
Elliott Hughes <enh@google.com> |
Declare that various Posix methods can throw SocketException. Bug: 5177516 Change-Id: Icf2f06c7df6686dd1f54a930bc3fa50b1ce4e1d4
|
e3b6fa2bf357f2712ab2ee9e8487f157595ea0c7 |
|
10-Jun-2011 |
Elliott Hughes <enh@google.com> |
Expose pread and pwrite. And fix FileChannel to use them. Bug: 4183719 Bug: 3107501 Change-Id: I51114a16522b93bf959b5953bec658e6889054c6
|
fc041ff241f9a7556e72236f130de0215ecd17db |
|
03-Jun-2011 |
Elliott Hughes <enh@google.com> |
Remove support for deprecated IPv4 address formats. Bug: 4539262 Change-Id: Ic42173b7b06e8536e8c4331087720d7df1e1681a
|
9b510df35b57946d843ffc34cf23fdcfc84c5220 |
|
28-May-2011 |
Elliott Hughes <enh@google.com> |
Make ErrnoException a checked exception. Bug: 4486011 Change-Id: I1877ce593d441653f75ab14884aa2d85f52652ad
|
9e67ca71d3d4a489a157abadc5ba519ced7a0b50 |
|
20-May-2011 |
Elliott Hughes <enh@google.com> |
Expose waitpid(2). This lets us move the process reaper up into Java. I've rearranged the code a bit for the benefit of those looking at stack traces: it's now much clearer when we're idle because there are no children to wait on, which previously looked like we were blocked trying trying to report the exit of a child. Bug: 3107501 Change-Id: I8c5c2952cbdbf9b5a6d8954b4964011d052a90a3
|
553d98af897f7202de5e5a776287de0b5ca8fe39 |
|
19-May-2011 |
Elliott Hughes <enh@google.com> |
Expose accept(2). The implementation of PlainSocketImpl.accept is made ugly by the fact that the SocketImpl we mutate may share its FileDescriptor with a SocketChannel, so we need to mutate the FileDescriptor itself, and can't simply swap in a new one. I've raised http://b/4452981 to see if we can integrate the nio and io socket classes more closely, to avoid this kind of mess. Bug: 3107501 Change-Id: I4964b64c25e936a44d1e4c22504ca29bba247ab6
|
23ec09188303a874b3b391f96ae0a29af002bff9 |
|
19-May-2011 |
Elliott Hughes <enh@google.com> |
Implement recvfrom(2). This one's a little bit hairy because of multiple return values. Bug: 3107501 Change-Id: I3bd35647d94bb6bc2192d6f31a39ecca07a3926e
|
90d96a4f168b7e56cff54dc94dca2f3cde60ebcd |
|
17-May-2011 |
Elliott Hughes <enh@google.com> |
Add sendto(2) and reimplement all network writes in terms of it. Note that this doesn't fix http://b/4182806. Bug: 3107501 Change-Id: I9b56eae226389a63a12b4c0499d40d5a54a462e2
|
d4419fce71d11ec8494525eca65e54d1aab51de6 |
|
13-May-2011 |
Elliott Hughes <enh@google.com> |
Add getpwnam(3) and getpwuid(3). Bug: 3107501 Change-Id: I727029758fd495471a9103f6ba259f0a5410b0ab
|
396a9c666da353b910b515d12eb1c43adfddb0c8 |
|
13-May-2011 |
Elliott Hughes <enh@google.com> |
Expose getpid(2) and a bunch of its friends. Bug: 3107501 Change-Id: I71127752373abab67eea339b9afbea03148bece0
|
70c820401677ca251ad09ac64cc23c760764e75d |
|
12-May-2011 |
Elliott Hughes <enh@google.com> |
Expose poll(2) and reimplement java.nio.channels.Selector. This also adds UnsafeArrayList<T>, which is like ArrayList but lets you access the underlying array (as opposed to ArrayList.toArray which creates a copy). Bug: 3107501 Change-Id: I8dc570a9fd7951b1435047017ea7aa19f8f8fc53
|
996bf79565ac88402920bd826d6f85952c83be20 |
|
10-May-2011 |
Elliott Hughes <enh@google.com> |
Expose connect(2). The new NET_FAILURE_RETRY in Posix.cpp is intended to replace the legacy one in NetFd.h, but during the transition we need both. The new one also takes care of the asynchronous Socket.close semantics, and changes the behavior when the FileDescriptor is invalid on entry: that is now reported as EBADF; it's only reported as "Socket closed" when we've been round the loop at least once, giving us reason to believe the socket was ever open. Having had to debug this distinction, I think the new semantics are less confusing. Bug: 3107501 Change-Id: I243dc4fa2eddde7ba40e9b66ec8fc555bc4e80f9
|
da15009528cc8300a6251f1d0931ac8657c9fc31 |
|
09-May-2011 |
Elliott Hughes <enh@google.com> |
Expose bind(2). I've renamed the java.net.InetAddress to struct sockaddr conversion functions too, after initially screwing up this patch by copy & pasting a usage of the one that only one caller actually wants. Now the name's so ugly no-one will be likely to use it by accident. Bug: 3107501 Change-Id: I869a8d27fc40e462505e02bf25a67e771a403e92
|
1c039d71d3879f39e3a75b8788e656f7b4f88f08 |
|
05-May-2011 |
Elliott Hughes <enh@google.com> |
Add getaddrinfo(2). This only supports the "node" side of getaddrinfo(2), not the "service" side. There's also no support for AI_CANONNAME, so we currently return InetAddress[] rather than anything equivalent to C's linked list of struct addrinfo. Bug: 3107501 Change-Id: I8cf6baa3027a0fa05ac6e2f8fcc1dd8b576ff8c4
|
a5fb706fe4a6dbeaaf4cb1f8bbc2c68b0a2a3f3c |
|
29-Apr-2011 |
Elliott Hughes <enh@google.com> |
Add kill(2) to Libcore.os. Also kick the tires of ProcessManager, since we'll probably have to do some unrelated work in here soon. Bug: 3107501 Change-Id: I132c1e09d21ffcf0d5ea4aab93f04a36c1b30eaf
|
0568a63ba1086a78ffb4cff68dd2eac4f9908e13 |
|
26-Apr-2011 |
Elliott Hughes <enh@google.com> |
Fix ByteBuffer.put(ByteBuffer). To do this tastefully required some cunning in the native code. The new ScopedBytesRO/ScopedBytesRW classes let us paper over the differences between byte[] and DirectByteBuffer, which in turn lets us paper over the differences between the various kinds of ByteBuffer. I've also rewritten Posix.read/Posix.readDirectBuffer and Posix.write/Posix.writeDirectBuffer to use the same idea. I haven't rewritten readv and writev, but can do and probably should. Bug: http://code.google.com/p/android/issues/detail?id=16184 Change-Id: Ia30d2f2fe1b1716a8f068187df2218b407a55aae
|
a37e971343883bb582a93ffbd9f0ba84f10e55ba |
|
21-Apr-2011 |
Elliott Hughes <enh@google.com> |
Rewrite NetworkInterface. This is part of the POSIX work, but also fixes a bug that asked for down interfaces to be returned. Additionally, I found a few bugs while rewriting this code. Most notably, we used to return a bogus broadcast address for the loopback interface. The only difference I notice between us and the RI when running on the host is that the RI claims that 127.0.0.1 has a prefix length of 0 rather than 8. I believe that we are correct on this issue. Bug: 4082343, 3107501 Change-Id: I677e0698e3a86676b4332b5d56fe514a99c3ddc0
|
4f11ebea266eada830d507b8f011e811a8e5d7bc |
|
20-Apr-2011 |
Elliott Hughes <enh@google.com> |
Add getnameinfo(3) (and gai_strerror(3)). There's quite a large corresponding change to InetAddress, plus I've changed the documentation for all the Permission classes to match the handful that we'd already documented as legacy cruft. Bug: http://b/3107501 Change-Id: Ia67aba79f0ab13e64085bd4a2df20ad0776bcc5b
|
b974666d79ebc392b37ec1ae83aae57ae6331c08 |
|
06-Apr-2011 |
Elliott Hughes <enh@google.com> |
Finish setsockopt(2). Bug: 3107501 Change-Id: I8f026dcba78acb555834bdcc594e114238f3cc52
|
438cb9e440d250c8aa5daf4fae0c400dce8b1499 |
|
02-Apr-2011 |
Elliott Hughes <enh@google.com> |
Add MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP setsockopt(2). Bug: 3107501 Change-Id: I576f45f8c67b6172888bc0541e3d3a462bfa311a
|
c63f0d4e80a9fd3bdf99cd438d108b750226736a |
|
02-Apr-2011 |
Elliott Hughes <enh@google.com> |
Add more of setsockopt(2). This covers all the easy cases. I'll do the awkward ones separately. Bug: 3107501 Change-Id: Ie424290e0bef76516d0c57e9c077cb1c202381ad
|
0a9d1ee45a9884a9616624d747172e18734e8fe0 |
|
31-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add getsockname(2) and getsockopt(2). Bug: 3107501 Change-Id: Ibb0d5a576ecb46e51dbda6051776145eec9e7fe1
|
462bdac45c10f43d88d8f07f6994e272a27c14a2 |
|
30-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add close(2). This is sufficient for non-socket fds, but may need to change to support the asynchronous socket close monitor. (Hopefully not; I'd rather lift that into Java.) I've also changed the semantics of IoUtils.close to match those desired by all callers: ignore null/invalid FileDescriptors. Bug: 3107501 Change-Id: Iad5c31c8f0f34d2a5ab1ed4581509b46af28bd1f
|
454a95f6a28855aa3c88d168b15a45bf315efc99 |
|
30-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add socket(2) and start adding setsockopt(2). I've added just enough setsockopt to keep the hack from our old socket creation code. More later (but not necessarily right away). Bug: 3107501 Change-Id: Id57bdd3c760bc58ed79d675b268c55493cbc24c8
|
8b15dcc5890963edad4dfcf558cc16027c7985e5 |
|
29-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add sendfile(2). This patch marks the end of OSFileSystem. Having to support a Java "long*" for sendfile(2) gave me an opportunity to go back and improve my ioctl(2) to use a corresponding "int*" equivalent, instead of its previous special-case hack. Bug: 3107501 Change-Id: I9fde4777700552263fab4fe9aeb556174163e3dc
|
bbac92e691de7d570928ddfba639067978e55b06 |
|
29-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add readv(2)/writev(2). The old implementation would cheat if it was given non-direct buffers, copying them into newly-allocated direct buffers. (The network Channel implementations are worse: they copy all the data into a single buffer, and then read/write that. I'll get to them eventually.) Bug: 3107501 Change-Id: I1655bacb042e7ebcde7e5bc5cf2c71e7ce5e30af
|
461d0d860814c68154d8dd06d24f94118f33d28a |
|
29-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add ioctl(2) for int*. I'm not adding the "struct ifreq" stuff yet because that's really hairy and I plan on rewriting the NetworkInterface implementation anyway, so it'll mainly be based on /proc. With any luck, we won't even need those other ioctls then. I'm not sure _this_ ioctl is a good idea, but it does seem like a slight improvement on the old code, and we can always move it back out if/when these APIs become more public. Bug: 3107501 Change-Id: Iceac15e4a107c33bfc8795976a747c2ffa59a183
|
4af0d8c99d68bcacff182699527d983a1d34fdbe |
|
28-Mar-2011 |
Elliott Hughes <enh@google.com> |
Support read-only ByteBuffers. Buffer.array() and Buffer.arrayOffset() throw for read-only buffers. We need to work round this. We know that this is safe because we trust ourselves not to write to read-only buffers and because all non-direct buffers have a backing array. Bug: 3107501 Change-Id: I501a5f7ddba2c66d22864bf4a41b927263493293
|
78c7cc547101002b9f9043cf3845970719d1bda8 |
|
26-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add write(2). Note that this is a functional change, because the old code was wrong: it assumed that short writes don't happen. I thought we'd (I'd) cleaned this up just recently, but it looks like I must have only gone through the network code. Embarrassing. This also cleans up the previous read change a bit, factoring out a bit more duplication, and taking advantage of the fact that we now get decent exceptions thrown from invalid FileDescriptors (meaning we can remove explicit checks). Bug: 3107501 Change-Id: I8bd5324836c9d151dceaef5b84ec523a67391b64
|
26c7025a7a919044771fb89031161bd26fe03032 |
|
26-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add read(2). For both byte[]s and ByteBuffers. Bug: 3107501 Change-Id: I93b781069ade4507371c8fe8c5fda0163fbb2dbb
|
fc549a0b0388987b26dea524894d75a63d14783b |
|
25-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add fcntl(2). I initially used overloading, but that actually decreases safety in practice because which overload you need is (uniquely) determined by the specific command you're issuing. Forcing callers to explicitly state what they're doing works around this. As it was, I had to use strace(1) to find my bug. Bug: 3107501 Change-Id: Ia54b72dd6453372922f01b22f382eb93ac91aaa7
|
7341b9ed7157a1e37a3e69a0974676da358b735a |
|
24-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add uname(2). This replaces InetAddress's use of gethostname(2), and System's hard-coded use of uname(2) itself. Bug: 3107501 Change-Id: I7e808177eece1e38428fea18a96c65628d51d93e
|
e1502d64e937001636fca3d62b2552ef2a34d05f |
|
24-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add listen(2). Bug: 3107501 Change-Id: I3677bb4ddb3f3d0e58a6833165504f47bb309630
|
59e4744d27231f260271dbbca406e0cc39768116 |
|
24-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add shutdown(2). Bug: 3107501 Change-Id: I30354c4cc6e86a4e7b0e3f84e95719539db1d297
|
41f0605d2c809bd9bc1c0fb68d86b49a0f59b6c5 |
|
24-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add pipe(2). This lets us kill quite a bit of IoUtils. Bug: 3107501 Change-Id: Ic8a297b29cc53a17841cc77e266cd8dc3910c521
|
c7fa20701d5e9398c38f4615ed293acfce1c0cf6 |
|
24-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add mkdir(2) and remove(2). Bug: 3107501 Change-Id: Ia4ca50b957d6015fa49076806273054563d25b63
|
b7190190e0ef8de883c952efb319ce7748831faa |
|
24-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add chmod(2). Bug: 3107501 Change-Id: If3a0639634a90f607b8c6035f25b03d23e7261e0
|
59fa7163774d6930a174bc038414a4b780581957 |
|
23-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add statfs(2). Bionic doesn't support statvfs(2), so we'll have to use statfs(2) in the meantime. We should fix this before making this API public, though. Bug: 3107501 Change-Id: I1af8a473261586321543dd1554e1f6079a84f384
|
a20cc6fca30d18e05db67ceeb0403b7b58ffd364 |
|
23-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add rename(2) and symlink(2). And use them too. Bug: 3107501 Change-Id: I83b512a2553bfc2501d02c251a4649f8e670774e
|
0ac77ac8e915bff1a863e371f9b363033f9cf759 |
|
23-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add open(2). Bug: 3107501 Change-Id: I404030b4c678862465d04f723a6a324663e0af25
|
0f746ff511162add42eeabaf14ba70ace874c6f4 |
|
23-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add mincore(2). Bug: 3107501 Change-Id: Ibb288b0889ff47612f77870239f51928b35754a9
|
7e13c0f05ac9e7c55682d10e953dd4cbd5e6107c |
|
19-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add mlock(2) and munlock(2). Bug: 3107501 Change-Id: I7e4cad36370196d990c709bfa33f89d7568aa453
|
7e25eff38a191d9c19e45093f4fde5102fb09d78 |
|
19-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add mmap(2), msync(2), and munmap(2). Bug: 3107501 Change-Id: I6a7c4147ec27bab9ded280476bad1157ce03fab8
|
9a3f363523000704205df288f8b6f2f48c0d8563 |
|
19-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add isatty(2). Bug: 3107501 Change-Id: I67e4a4ceeba945095419d176e7de5edb7da8a440
|
dedaccdfa07c370a58cba08b096133ad9eec0ec3 |
|
18-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add lseek(2). Bug: 3107501 Change-Id: Ie27e2ae1c7d37de5f02b1d81ee2005182339f881
|
f5333fd2094bdac4d6506177b1964b79afa64d77 |
|
18-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add ftruncate(2). The claim that "the port library" modifies the file offset appears to only ever have been true of Harmony's Win32 implementation. Certainly, this is not the behavior of ftruncate(2), so we can lose the cruft. Bug: 3107501 Change-Id: I35092fd986296b78c4847c7215765f9997339f37
|
6fc1a0e1e68dc2e0d12341548e58fa7f1c5dafc4 |
|
18-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add sysconf(3). This gives us a getpagesize(3) replacement right now, and will let us implement Runtime.availableProcessors here rather than in the VM in a later change. Bug: 3107501 Change-Id: I6fc1f83d36b026fbe8d37eca525550479677f2de
|
47cb338d43f75dd998b29caaaa9446c5705217d1 |
|
18-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add fstat(2), lstat(2), and stat(2). Bug: 3107501 Change-Id: Ic36f9ffd03446d6e0189470f42abdadde57327df
|
52724d3ebd4ccaaa4b9f5576e329d4272cde8ea9 |
|
17-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add fsync(2) and fdatasync(2). Interesting parts to this change: * first BlockGuard support (and general delegation support). * first rethrowing of ErrnoException as IOException. * switching FileChannelImpl from int to FileDescriptor. The special case in FileDescriptor.sync has been removed. Testing with the RI showed that it doesn't treat syncing a FileDescriptor that corresponds to a socket as a special case --- it throws SyncFailedException just like normal. Bug: 3107501 Change-Id: I99faf120bd802aec0397a79772ed38c5e1542fed
|
ddfdbb9d172fe9b72e08e8d7deab0aa3b8acf044 |
|
17-Mar-2011 |
Elliott Hughes <enh@google.com> |
Add access(2), strerror(3) and access to environ. Update java.io.File and java.lang.System to use the new functionality rather than brewing their own. Bug: 3107501 Change-Id: I5fa63190d240d638f44a911401143ffb2af9d395
|
ec617e2cb4a374f0fd8fbda4a633214cf23a59a9 |
|
17-Mar-2011 |
Elliott Hughes <enh@google.com> |
Move the getenv(3) native code out of System as a demo. This is a fairly trivial patch, just to show the general structure. Bug: 3107501 Change-Id: I547df621ccb8b8874e5f74c4d0bcf84ccaef97c3
|