summaryrefslogtreecommitdiffstats
path: root/include/c.h
Commit message (Collapse)AuthorAgeFilesLines
...
* misc: use %m in format string instead of %s and strerror(errno)Petr Uzel2011-09-271-1/+1
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* Merge branch 'sys-utils' of https://github.com/kerolasa/lelux-utiliteetitKarel Zak2011-09-271-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'sys-utils' of https://github.com/kerolasa/lelux-utiliteetit: (29 commits) docs: add non-return function and if shorthand tips build-sys: fixes to USAGE_* macros ipcrm: check IPC syscalls ipcrm: add --verbose option ipcmk: allow high speed ipc creation ipcrm: add --all option docs: add long options to ipcs.1 man page docs: add long options to ipcrm.1 man page docs: add long options to ipcmk.1 man page docs: add --version to setarch.8 docs: mention long options in ctrlaltdel.8 ctrlaltdel: add version & help options docs: mention long options in pivot_root.8 pivot_root: add version & help option ipcs: comment & white space clean up ipcs: include-what-you-use header check ipcs: add long options ipcrm: include-what-you-use header check ipcrm: refactor new and old main to share code ipcrm: exit if unknown error occurs ...
| * build-sys: fixes to USAGE_* macrosSami Kerola2011-09-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | The USAGE_BEGIN_TAIL is removed as unnecessary. In between command specific options and --help & --version USAGE_SEPARATOR is inserted. For now the separator is empty line. The USAGE_MAN_TAIL is changed to take an argument. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | include,c.h: include fcntl.h before check for O_CLOEXEC [smatch scan]Karel Zak2011-09-121-0/+1
|/ | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* arch: start using arch as a usage() exampleSami Kerola2011-08-281-0/+13
| | | | | | | The arch command is hijacked to be example of howto write usage as defined in Documentation/howto-usage-function.txt Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* include: [c.h] Include stdlib.h unconditionalymaximilian attems2011-08-021-1/+1
| | | | | | | No point in hiding it down in an ifdef maze, as it may get used by exit(3). Signed-off-by: maximilian attems <max@stro.at>
* include: [c.h] move up declaration of program_invocation_short_name before usagemaximilian attems2011-08-021-35/+35
| | | | | | | | | | | fixes: ../include/c.h: In function ‘errmsg’: ../include/c.h:111:26: error: ‘program_invocation_short_name’ undeclared (first use in this function) ../include/c.h:111:26: note: each undeclared identifier is reported only once for each function it appears in Signed-off-by: maximilian attems <max@stro.at>
* include: [c.h] add definition wrappers for old libc versionsDavidlohr Bueso2011-03-291-1/+11
| | | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* include: [c.h]: remove strings.h include dublicateSami Kerola2011-03-081-1/+0Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* include: [c.h]: typeof to __typeof__ fixSami Kerola2011-03-081-6/+6
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: provide alternatives for err, errx, warn and warnxFabian Groffen2011-02-141-0/+47
| | | | | | | | Solaris lacks err, errx, warn and warnx. This also means the err.h header doesn't exist. Removed err.h include from all files, and included err.h from c.h instead if it exists, otherwise alternatives are provided. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* include: [c.h]: add fallback for old libs without O_CLOEXECKarel Zak2011-02-111-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include: [c.h]: add unused attribute to ignore_result()Karel Zak2011-02-091-1/+3
| | | | | | | | | | | | | | unfortunately, gcc 4.6 void fn (void) { int foo; foo = bar (); } evaluates that foo is never used. The __attribute__((unused)) is necessary... Signed-off-by: Karel Zak <kzak@redhat.com>
* include: [c.h]: fix __alloc_size__ testKarel Zak2011-02-081-2/+2
| | | | | Reported-by: Francesco Cosoleto <cosoleto@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* include: [c.h] add fallback for alloc_size attributesKarel Zak2011-02-071-0/+27
| | | | | Reported-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* include: [c.h] move ignore_result() to gcc-only blockKarel Zak2011-02-071-1/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* provide a workaround if program_invocation_short_name is missingFabian Groffen2011-01-311-0/+36
| | | | | | | | | | | | Try some replacements, such as getexecname() on Solaris and __progname on BSDs and Darwin. When not found, base program_invocation_short_name on the source filename it is used in, as not to require argv[0] to be passed along. This latter approach is not dynamic, but doesn't require code changes for all places where program_invocation_short_name is used now. Signed-off-by: Fabian Groffen <grobian@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* include: emulate dirfd when necessaryFabian Groffen2011-01-231-0/+9
| | | | | | | | | | | | dirfd is not available on Solaris 10, it is available on latest OpenSolaris releases though. Do some autoconf trickery to determine if providing an alternative dirfd function is necessary and possible. shlibs/blkid/src/read.c: Do not define _XOPEN_SOURCE to 600, or DIR will lose it's dd_fd member again. Rearrange defines and includes to make sense per comments, and not conflict on Solaris. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* build-sys: check for loff_t, it may not existFabian Groffen2011-01-201-0/+4
| | | | | | | On some systems, loff_t does not exist. Define it as int64_t in that case. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* lib: [c] add ignore_result()Karel Zak2011-01-041-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: fix MBR detection on iPod and cleanup vfat codeKarel Zak2010-10-151-0/+6
| | | | | | | | | | | - move all FAT code to superblocks/vfat.c only - add a generic function to verify FAT superblock and use it in FAT prober as well as in MBR parser - add a more robust FAT cluster_count check (it seems that iPod contains an "almost valid" FAT superblock before MBR) Reported-by: Davidlohr Bueso <dave.bueso@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: add #ifndef around min() max() macrosKarel Zak2010-03-161-3/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include: add min/max macrosKarel Zak2010-02-121-0/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include: add c.h with fundamental C definitionsKarel Zak2009-10-161-0/+49
Add: * ARRAY_SIZE with array type check * PATH_MAX, TRUE and FALSE macros * dummy __attribute__ for non-gcc compilers Signed-off-by: Karel Zak <kzak@redhat.com>