Commit graph

13 commits

Author SHA1 Message Date
Elliott Hughes
dbf5b2eb55 Add POSIX <utmpx.h>.
Now <utmpx.h> isn't any more useful on Android than <utmp.h> is, but it
is POSIX, and -- importantly -- we can implement it with just a header
file, so code can use it on every existing API level.

macOS does indeed only have the <utmpx.h> functions (although it does
still have the <utmp.h> header!), so potentially portable code might
want <utmpx.h> on Android. (glibc/musl both have both headers.)

Bug: https://github.com/landley/toybox/pull/213
Test: treehugger
Change-Id: Iaa88167708182009a63e2e1a15f11186b251ed02
2023-04-03 17:20:58 -07:00
zijunzhao
d9755064a6 Nullability check for utmp module
Bugs: b/245972273
Test: None
Change-Id: Ie37781b87ad13119d1ebc4cd053e184d482d5b58
2023-01-25 19:22:27 +00:00
Elliott Hughes
9a1d3976f1 Reimplement our no-op utmp.h functions more simply.
Now we're being marked down for our poor coverage, we may as well remove
more broken cruft. Despite the amount of effort that seems to have gone
into pututline(), it wasn't working with the other utmp.h functions (in
particular, utmpname()), and wasn't declared in the header file!

Test: treehugger
Change-Id: I1a583984189c751168c11c01431433f96f8c548b
2020-08-07 17:07:31 -07:00
Elliott Hughes
faa74342e3 Name function arguments in libc headers for Studio.
First batch of headers...

Bug: http://b/64613623
Test: builds
Change-Id: I6bc3ad79daa635456b61d03b1f43f06c433ec596
2017-08-11 17:45:59 -07:00
Josh Gao
14adff1cfa Add versioning information to symbols.
Bug: http://b/28178111
Change-Id: I46bf95accd819f4521afb1173d8badcc5e9df31c
2016-04-29 16:39:50 -07:00
Elliott Hughes
9216a64c90 Fix <utmp.h> declarations.
If we're going to keep this useless header -- and I think it's too late to
remove it -- it may as well be correct.

Bug: http://b/17700469
Change-Id: Ifec4f8f1a984483d7fa7d81d47786f75b70ff4ba
2015-10-26 19:29:12 -07:00
Mike Frysinger
68af0adeb9 utmp.h: add more ut_type defines
This fills out the defines that utmp.h normally offers on other systems
such as glibc.

BUG=24810744

Change-Id: If57f9ced22e8673f072245fce3f5c0f8e1f591e5
2015-10-09 18:52:49 -04:00
Elliott Hughes
65f0df7873 Implement <pty.h>.
Based on the package/apps/Terminal implementation. I'll switch them over
shortly. This also lets us build the toybox version of netcat.

Change-Id: Ia922a100141a67409264b43b937eeca07b21f344
2014-12-03 15:55:34 -08:00
Calin Juravle
7d8f303353 Allow for better utmp logging.
Increase (UT_NAMESIZE,UT_LINESIZE,UT_HOSTSIZE) to (32,32,256).

Nobody writes utmp on Android but it would be nice to be aligned
with others who use 32,32,256 (like glibc). If ever used it will produce
nicer logging. There is no consensus in BSDs for these values.

Bug: 14584341
Bug: 12875898

Change-Id: I94af10b982b8f9fcaea897c4cf968563f38403f9
2014-05-06 15:44:14 +01:00
David 'Digit' Turner
bd8d987b3c libc: remove C++ comments from public headers.
Change-Id: I4af84f912062cd2ff34711c25122fb323f20c032
2010-09-27 17:35:26 +02:00
The Android Open Source Project
1dc9e472e1 auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
The Android Open Source Project
1767f908af auto import from //depot/cupcake/@135843 2009-03-03 18:28:13 -08:00
The Android Open Source Project
a27d2baa0c Initial Contribution 2008-10-21 07:00:00 -07:00