- 31 8月, 2020 1 次提交
-
-
由 w00349915 提交于
Description:add unsupport api print Team: OTHERS Feature or Bugfix:Feature Binary Source:No PrivateCode(Yes/No):No Change-Id: If54639f876c6c6d546f36f65a83e3d4ae94a58f0 Reviewed-on: http://mgit-tm.rnd.huawei.com/10522043Tested-by: Npublic jenkins <public_jenkins@notesmail.huawei.com> Reviewed-by: Ncaoruihong 00546070 <crh.cao@huawei.com> Reviewed-by: Nshenwei 00579521 <denny.shenwei@huawei.com>
-
- 17 8月, 2020 1 次提交
-
-
由 c00346986 提交于
Description:userspace musl code Team:OTHERS Feature or Bugfix:Feature Binary Source:NA PrivateCode(Yes/No):No Change-Id: I1d445ef7d16285be98b1857f4c01b94c9759daea Reviewed-on: http://mgit-tm.rnd.huawei.com/10274931Reviewed-by: Ncaoruihong 00546070 <crh.cao@huawei.com> Tested-by: Npublic jenkins <public_jenkins@notesmail.huawei.com> Reviewed-by: Nshenwei 00579521 <denny.shenwei@huawei.com>
-
- 23 12月, 2019 2 次提交
-
-
由 Rich Felker 提交于
adding this condition makes the entire convert_ioctl_struct function and compat_map table statically unreachable, and thereby optimized out by dead code elimination, on archs where they are not needed.
-
由 Rich Felker 提交于
VIDIOC_OMAP3ISP_STAT_REQ is a device-specific command for the omap3isp video device. the command number is in a device-private range and therefore could theoretically be used by other devices too in the future, but problematic clashes should not be able to arise without intentional misuse.
-
- 22 12月, 2019 1 次提交
-
-
由 Rich Felker 提交于
there's only one matching entry for any given command so this had no functional distinction, but additional loops are pointless and wasteful.
-
- 20 12月, 2019 1 次提交
-
-
由 Rich Felker 提交于
this commit covers all remaining ioctls I'm aware of that use time_t-derived types in their interfaces. it may still be incomplete, and has undergone only minimal testing for a few commands used in audio playback. the SNDRV_PCM_IOCTL_SYNC_PTR command is special-cased because, rather than the whole structure expanding, it has two substructures each padded to 64 bytes that expand within their own 64-byte reserved zone. as long as it's the only one of its type, it doesn't really make sense to make a general framework for it, but the existing table framework is still used for the substructures in the special-case. one of the substructures, snd_pcm_mmap_status, has a snd_pcm_uframes_t member which is not a timestamp but is expanded just like one, to match the 64-bit-arch version of the structure. this is handled just like a timestamp at offset 8, and is the motivation for the conversions table holding offsets of individual values to be expanded rather than timespec/timeval type pairs. for some of the types, the size to which they expand is dependent on whether the arch's ABI aligns 8-byte types on 8-byte boundaries. new_req entries in the table need to reflect this size to get the right ioctl request number that will match what callers pass, but we don't have access to the actual structure type definitions here and duplicating them would be cumbersome. instead, the new_misaligned macro introduced here constructs an artificial object whose size is the result of expanding a misaligned timespec/timeval to 64-bit and imposing the arch's alignment on the result, which can be passed to the _IO{R,W,WR} macros.
-
- 19 12月, 2019 2 次提交
-
-
由 Rich Felker 提交于
record offsets of individual slots that expand from 32- to 64-bit, rather than timespec/timeval pairs. this flexibility will be needed for some ioctls. reduce size of types in table. adjust representation of offsets to include a count rather than needing -1 padding so that the table is less ugly and doesn't need large diffs if we increase max number of slots.
-
由 Rich Felker 提交于
with the current set of supported ioctls, this conversion is hardly an improvement, but it sets the stage for being able to do alsa, v4l2, ppp, and other ioctls with timespec/timeval-derived types. without this capability, a lot of functionality users depend on would stop working with the time64 switchover.
-
- 24 10月, 2019 1 次提交
-
-
由 Rich Felker 提交于
linux fails the open with ENOSPC, but POSIX mandates EAGAIN.
-
- 20 10月, 2019 1 次提交
-
-
由 Rich Felker 提交于
presently the kernel does not actually define time64 versions of these syscalls, and they're not really needed except to represent extreme cpu time usage. however, x32's versions of the syscalls already behave as time64 ones, meaning the functions were broken on x32 if the caller used any part of the rusage result other than ru_utime and ru_stime. commit 7e817114 made it possible to fix this by treating x32's syscalls as time64 versions. in the non-time64-syscall case, make the syscall with the rusage destination pointer adjusted so that all members but the timevals line up between the libc and kernel structures. on 64-bit archs, or present 32-bit archs with 32-bit time_t, the timevals will line up too and no further work is needed. for future 32-bit archs with 64-bit time_t, the timevals are copied into place, contingent on time_t being larger than long.
-
- 31 8月, 2019 1 次提交
-
-
由 Rich Felker 提交于
commit 030e5263 added optreset, a BSD extension to getopt duplicating the functionality (also an extension) of setting optind to 0, but failed to provide a public declaration for it. according to the BSD documentation and headers, the application is not supposed to need to provide its own declaration.
-
- 01 8月, 2019 1 次提交
-
-
由 Rich Felker 提交于
without this, the SIOCGSTAMP and SIOCGSTAMPNS ioctl commands, for obtaining timestamps, would stop working on pre-5.1 kernels after time_t is switched to 64-bit and their values are changed to the new time64 versions. new code is written such that it's statically unreachable on 64-bit archs, and on existing 32-bit archs until the macro values are changed to activate 64-bit time_t.
-
- 10 12月, 2018 2 次提交
-
-
由 Rich Felker 提交于
-
由 Rich Felker 提交于
-
- 13 9月, 2018 9 次提交
-
-
由 Rich Felker 提交于
this further reduces the number of source files which need to include libc.h and thereby be potentially exposed to libc global state and internals. this will also facilitate further improvements like adding an inline fast-path, if we want to do so later.
-
由 Rich Felker 提交于
the LFS64 macro was not self-documenting and barely saved any characters. simply use weak_alias directly so that it's clear what's being done, and doesn't depend on a header to provide a strange macro.
-
由 Rich Felker 提交于
libc.h was intended to be a header for access to global libc state and related interfaces, but ended up included all over the place because it was the way to get the weak_alias macro. most of the inclusions removed here are places where weak_alias was needed. a few were recently introduced for hidden. some go all the way back to when libc.h defined CANCELPT_BEGIN and _END, and all (wrongly implemented) cancellation points had to include it. remaining spurious users are mostly callers of the LOCK/UNLOCK macros and files that use the LFS64 macro to define the awful *64 aliases. in a few places, new inclusion of libc.h is added because several internal headers no longer implicitly include libc.h. declarations for __lockfile and __unlockfile are moved from libc.h to stdio_impl.h so that the latter does not need libc.h. putting them in libc.h made no sense at all, since the macros in stdio_impl.h are needed to use them correctly anyway.
-
由 Rich Felker 提交于
-
由 Rich Felker 提交于
commits leading up to this one have moved the vast majority of libc-internal interface declarations to appropriate internal headers, allowing them to be type-checked and setting the stage to limit their visibility. the ones that have not yet been moved are mostly namespace-protected aliases for standard/public interfaces, which exist to facilitate implementing plain C functions in terms of POSIX functionality, or C or POSIX functionality in terms of extensions that are not standardized. some don't quite fit this description, but are "internally public" interfacs between subsystems of libc. rather than create a number of newly-named headers to declare these functions, and having to add explicit include directives for them to every source file where they're needed, I have introduced a method of wrapping the corresponding public headers. parallel to the public headers in $(srcdir)/include, we now have wrappers in $(srcdir)/src/include that come earlier in the include path order. they include the public header they're wrapping, then add declarations for namespace-protected versions of the same interfaces and any "internally public" interfaces for the subsystem they correspond to. along these lines, the wrapper for features.h is now responsible for the definition of the hidden, weak, and weak_alias macros. this means source files will no longer need to include any special headers to access these features. over time, it is my expectation that the scope of what is "internally public" will expand, reducing the number of source files which need to include *_impl.h and related headers down to those which are actually implementing the corresponding subsystems, not just using them.
-
由 Rich Felker 提交于
it's not ideal, but the function is essentially an extended stdio function specialized to getopt's needs. the only reason it exists is avoiding pulling printf code into every program using getopt.
-
由 Rich Felker 提交于
the public flockfile interface is significantly heavier because it has to handle the possibility of caller returning or thread exiting while holding the lock.
-
由 Rich Felker 提交于
syscall.h was chosen as the header to declare it, since its intended usage is alongside syscalls as a fallback for operations the direct syscall does not support.
-
由 Rich Felker 提交于
policy is that all public functions which have a public declaration should be defined in a context where that public declaration is visible, to avoid preventable type mismatches. an audit performed using GCC's -Wmissing-declarations turned up the violations corrected here. in some cases the public header had not been included; in others, a feature test macro needed to make the declaration visible had been omitted. in the case of gethostent and getnetent, the omission seems to have been intentional, as a hack to admit a single stub definition for both functions. this kind of hack is no longer acceptable; it's UB and would not fly with LTO or advanced toolchains. the hack is undone to make exposure of the declarations possible.
-
- 23 8月, 2018 1 次提交
-
-
由 Rich Felker 提交于
the text of the specification for getopt's handling of options that require an argument, which requires updating optarg and optind, does not exclude the error case where the end of the argument list has been reached. in that case, it is expected that optarg be assigned argv[argc] (normally null) and optind be incremented by 2, resulting in a value of argc+1.
-
- 27 4月, 2018 1 次提交
-
-
由 Rich Felker 提交于
for getopt_long, partial (prefix) matches of long options always begin with "--" and thus can never be ambiguous with a short option. for getopt_long_only, though, a single-character option can match both a short option and as a prefix for a long option. in this case, we wrongly interpreted it as a prefix for the long option. introduce a new pass, only in long-only mode, to check the prefix match against short options before accepting it. the only reason there's a slightly nontrivial loop being introduced rather than strchr is that our getopt already supports multibyte short options, and getopt_long_long should handle them consistently. a temp buffer and strstr could have been used, but the code to set it up would be just as large as what's introduced here and it would unnecessarily pull in relatively large code for strstr.
-
- 26 2月, 2018 1 次提交
-
-
由 Rich Felker 提交于
general policy is that all source files defining a public API or an ABI mechanism referenced by a public header should include the public header that declares the interface, so that the compiler or analysis tools can check the consistency of the declarations. Alexander Monakov pointed out a number of violations of this principle a few years back. fix them now.
-
- 24 2月, 2018 1 次提交
-
-
由 Rich Felker 提交于
the ':' in optstring has special meaning as a flag applying to the previous option character, or to getopt's error handling behavior when it appears at the beginning. don't also accept a "-:" option based on its presence.
-
- 23 2月, 2018 1 次提交
-
-
由 Rich Felker 提交于
based loosely on patch by Hauke Mehrtens; converted to wrap the public API of the underlying getrandom function rather than direct syscalls, so that if/when a fallback implementation of getrandom is added it will automatically get picked up by getentropy too.
-
- 06 2月, 2018 1 次提交
-
-
由 Alexander Monakov 提交于
Do not retry waitpid if the child was terminated by a signal. Do not examine status: since we are not passing any flags, we will not receive stop or continue notifications.
-
- 01 2月, 2018 2 次提交
-
-
由 Samuel Holland 提交于
Consider the first equals sign found in the option to be the delimiter between it and its argument, even if it matches an equals sign in the option name. This avoids consuming the equals sign, which would prevent finding the argument. Instead, it forces a partial match of the part of the option name before the equals sign. Maintainer's note: GNU getopt_long does not explicitly document this behavior, but it can be seen as a consequence of how partial matches are specified, and at least GNU (bfd) ld is known to make use of it.
-
由 Samuel Holland 提交于
If we find a partial option name match, we need to keep looking for ambiguous/conflicting options. However, we need to remember the position in the candidate argument to find its option-argument later, if there is one. This fixes e.g. option "foobar" being given as "--fooba=baz".
-
- 10 1月, 2018 1 次提交
-
-
由 Jens Gustedt 提交于
In all cases this is just a change from two volatile int to one.
-
- 14 10月, 2017 1 次提交
-
-
由 Rich Felker 提交于
the rightmost '/' character is not necessarily the delimiter before the basename; it could be a spurious trailing character on the directory name. this change does not introduce any normalization of pathnames or stripping of trailing slashes, contrary to at least glibc and perhaps other implementations; it jusst prevents their presence from breaking things. whether further changes should be made is an open question that may depend on conformance and/or application compatibility considerations. based loosely on patch by Joakim Sindholt.
-
- 05 1月, 2017 1 次提交
-
-
由 Rich Felker 提交于
getopt is only specified to modify optopt on error, and some software apparently infers an error from optopt!=0. getopt_long is changed analogously. the resulting behavior differs slightly from the behavior of the GNU implementation of getopt_long, which keeps an internal shadow copy of optopt and copies it to the public one on return, but since the GNU implementation also exhibits this shadow-copy behavior for plain getopt where is is non-conforming, I think this can reasonably be considered a bug rather than an intentional behavior that merits mimicing.
-
- 21 10月, 2016 1 次提交
-
-
由 Rich Felker 提交于
-
- 20 10月, 2016 1 次提交
-
-
由 Natanael Copa 提交于
overlayfs may have fairly long lines so we use getline to allocate a buffer dynamically. The buffer will be allocated on first use, expand as needed, but will never be free'ed. Downstream bug: http://bugs.alpinelinux.org/issues/5703Signed-off-by: NNatanael Copa <ncopa@alpinelinux.org>
-
- 24 5月, 2016 1 次提交
-
-
由 Rich Felker 提交于
the difference of pointers is a signed type ptrdiff_t; if it is only 32-bit, left-shifting it by 30 bits produces undefined behavior. cast the difference to an appropriate unsigned type, uint32_t, before shifting to avoid this. the a64l function is specified to return a signed 32-bit result in type long. as noted in the bug report by Ed Schouten, converting implicitly from uint32_t only produces the desired result when long is a 32-bit type. since the computation has to be done in unsigned arithmetic to avoid overflow, simply cast the result to int32_t. further, POSIX leaves the behavior on invalid input unspecified but not undefined, so we should not take the difference between the potentially-null result of strchr and the base pointer without first checking the result. the simplest behavior is just returning the partial conversion already performed in this case, so do that.
-
- 17 2月, 2016 1 次提交
-
-
由 Rich Felker 提交于
like fputs (see commit 10a17dfb), the message printing code for getopt assumed that fwrite only returns 0 on failure, but it can also happen on success if the total length to be written is zero. programs with zero-length argv[0] were affected. commit 500c6886 introduced this problem in getopt by fixing the fwrite behavior to conform to the requirements of ISO C. previously the wrong expectations of the getopt code were met by the fwrite implementation.
-
- 21 8月, 2015 1 次提交
-
-
由 Steven Barth 提交于
getsubopt incorrectly returns the delimiting = in the value string, this patch fixes it by increasing the pointer position by one. Signed-off-by: NSteven Barth <cyrus@openwrt.org>
-
- 10 7月, 2015 1 次提交
-
-
由 Rich Felker 提交于
when traditional syslogd implementations are restarted, the old server socket ceases to exist and a new unix socket with the same pathname is created. when this happens, the default destination address associated with the client socket via connect is no longer valid, and attempts to send produce errors. this happens despite the socket being datagram type, and is in contrast to the behavior that would be seen with an IP datagram (UDP) socket. in order to avoid a situation where the application is unable to send further syslog messages without calling closelog, this patch makes syslog attempt to reconnect the socket when send returns an error indicating a lost connection. additionally, initial failure to connect the socket no longer results in the socket being closed. this ensures that an application which calls openlog to reserve the socket file descriptor will not run into a situation where transient connection failure (e.g. due to syslogd restart) prevents fd reservation. however, applications which may be unable to connect the socket later (e.g. due to chroot, restricted permissions, seccomp, etc.) will still fail to log if the syslog socket cannot be connected at openlog time or if it has to be reconnected later.
-