Displaying 20 results from an estimated 54 matches for "uintmax_t".
2009 May 29
1
[PATCH v2] klibc-utils: add simple ls
...size_t max_linksiz = 128;
+static int max_nlinks = 1;
+static int max_size = 1;
+static int max_uid = 1;
+static int max_gid = 1;
+static int max_min = 1;
+static int max_maj = 1;
+
+static void do_preformat(const struct stat *st)
+{
+ int bytes;
+
+ if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->st_nlink)) > max_nlinks)
+ max_nlinks = bytes;
+
+ if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->st_uid)) > max_uid)
+ max_uid = bytes;
+
+ if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->st_gid)) > max_gid)
+ max_gid = bytes;
+
+ if (S_IS...
2009 May 28
1
[PATCH] klibc-utils: add minils
...de) & mask) == mask)
+
+static int max_nlinks = 1;
+static int max_size = 1;
+static int max_uid = 1;
+static int max_gid = 1;
+static int max_min = 1;
+static int max_maj = 1;
+
+static void do_preformat(const struct stat *st) {
+ int bytes;
+
+ if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->st_nlink)) > max_nlinks)
+ max_nlinks = bytes;
+
+ if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->st_uid)) > max_uid)
+ max_uid = bytes;
+
+ if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->st_gid)) > max_gid)
+ max_gid = bytes;
+
+ if (S_IS...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Remove getintmax in printf
...f --git a/usr/dash/bltin/printf.c b/usr/dash/bltin/printf.c
index 5cd34a19..b439a3bb 100644
--- a/usr/dash/bltin/printf.c
+++ b/usr/dash/bltin/printf.c
@@ -46,8 +46,7 @@ static int getchr(void);
#ifdef HAVE_STRTOD
static double getdouble(void);
#endif
-static intmax_t getintmax(void);
-static uintmax_t getuintmax(void);
+static uintmax_t getuintmax(int);
static char *getstr(void);
static char *mklong(const char *, const char *);
static void check_conversion(const char *, const char *);
@@ -181,14 +180,14 @@ pc:
/* skip to field width */
fmt += strspn(fmt, SKIP1);
if (*fmt == &...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Remove getintmax in printf
...f --git a/usr/dash/bltin/printf.c b/usr/dash/bltin/printf.c
index 5cd34a19..b439a3bb 100644
--- a/usr/dash/bltin/printf.c
+++ b/usr/dash/bltin/printf.c
@@ -46,8 +46,7 @@ static int getchr(void);
#ifdef HAVE_STRTOD
static double getdouble(void);
#endif
-static intmax_t getintmax(void);
-static uintmax_t getuintmax(void);
+static uintmax_t getuintmax(int);
static char *getstr(void);
static char *mklong(const char *, const char *);
static void check_conversion(const char *, const char *);
@@ -181,14 +180,14 @@ pc:
/* skip to field width */
fmt += strspn(fmt, SKIP1);
if (*fmt == &...
2015 Jul 02
0
[PATCH] Fix various -Wformat problems.
...e enabled. This
has revealed many problems in C format strings. The fixes here fall
into the following main categories:
- Using %d with an unsigned parameter.
- %x and %o expect an unsigned argument.
- uid_t and gid_t are unsigned on Linux. The safe way to print these
is to cast them to uintmax_t and then print then using the %ju
modifier (see http://stackoverflow.com/a/1401581).
- Using %d to print an enum. Since enums may be either char or int,
I fixed this by casting the enum to int.
- strtol_error & lzma_ret are both unsigned types.
---
builder/pxzcat-c.c | 24 ++++++...
2015 Jul 02
0
[PATCH v2] Fix various -Wformat problems.
...e enabled. This
has revealed many problems in C format strings. The fixes here fall
into the following main categories:
- Using %d with an unsigned parameter.
- %x and %o expect an unsigned argument.
- uid_t and gid_t are unsigned on Linux. The safe way to print these
is to cast them to uintmax_t and then print them using the %ju
modifier (see http://stackoverflow.com/a/1401581).
- Using %d to print an enum. Since enums may be either char or int,
I fixed this by casting the enum to int.
- strtol_error & lzma_ret are both unsigned types.
---
builder/pxzcat-c.c | 24 ++++++...
2017 Dec 12
2
[PATCH] df: Handle block sizes smaller than 1024 bytes (RHBZ#1525241).
...1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/df/output.c b/df/output.c
index eed7f384d..18f76b155 100644
--- a/df/output.c
+++ b/df/output.c
@@ -80,6 +80,22 @@ print_title (void)
}
}
+/* scale (n, 4096, 1024) ==> n * 4
+ * scale (n, 512, 1024) ==> n / 2
+ */
+static uintmax_t
+scale (uintmax_t n, uintmax_t from, uintmax_t to)
+{
+ if (from >= to) {
+ uintmax_t multiplier = from / to;
+ return n * multiplier;
+ }
+ else {
+ uintmax_t divisor = to / from;
+ return n / divisor;
+ }
+}
+
void
print_stat (FILE *fp,
const char *name, const ch...
2011 Jul 07
5
[PATCH 0/5] checkpatch cleanups
It seems checkpatch errors krept in, this is a first go.
Next run will go into usr/kinit directory.
No code changes, just codingstyle fixes (verified with size(3)).
maximilian attems (5):
[klibc] sleep: have argument on next line
[klibc] readklink: remove unneeded braces
[klibc] mount: whitespace policy
[klibc] ls: fix various checkpatch complaints
[klibc] tests: checkpatch fixlets
2003 Aug 05
1
compile with dietlibc
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
I'm used to test the software which I use with dietlibc, just to see if it
could run without the bloat of glibc.
While compiling dovecot 0.99.10 I got these errors:
In file included from lib.h:20,
from alarm-hup.c:26:
compat.h:30: conflicting types for `uint_fast32_t'
/opt/diet/include/stdint.h:25: previous
2013 Oct 09
0
[PATCH 1/1] Porting klibc to AArch64
...tatfs64(path, sizeof *buf, buf);
+ return __statfs64(path, buf);
}
#endif
diff --git a/usr/klibc/tests/stat.c b/usr/klibc/tests/stat.c
index 4410833..ff97d12 100644
--- a/usr/klibc/tests/stat.c
+++ b/usr/klibc/tests/stat.c
@@ -36,12 +36,12 @@ static void do_stat(const char *path)
(uintmax_t) st.st_blksize, (uintmax_t) st.st_blocks);
#ifdef _STATBUF_ST_NSEC
- printf(" st_atim = %jd.%09u\n"
- " st.mtim = %jd.%09u\n"
- " st.ctim = %jd.%09u\n",
- (uintmax_t) st.st_atim.tv_sec, (unsigned int)st.st_atim.tv...
2016 May 12
0
[PATCH 3/4] appliance: Move code for creating supermin appliance directory to tmpdirs.c.
...nel, char **initrd,
char **appliance)
{
- CLEANUP_FREE char *tmpdir = guestfs_get_cachedir (g);
CLEANUP_FREE char *cachedir = NULL, *lockfile = NULL, *appliancedir = NULL;
- struct stat statbuf;
- cachedir = safe_asprintf (g, "%s/.guestfs-%ju", tmpdir, (uintmax_t) uid);
- lockfile = safe_asprintf (g, "%s/lock", cachedir);
+ cachedir = guestfs_int_lazy_make_supermin_appliance_dir (g);
+ if (cachedir == NULL)
+ return -1;
+
appliancedir = safe_asprintf (g, "%s/appliance.d", cachedir);
+ lockfile = safe_asprintf (g, "%s/lock&...
2005 Apr 21
1
Fwd: (KAME-snap 9012) racoon in the kame project
FYI, looks like support for Racoon is ending. Does anyone have any
experience with the version in ipsec-tools ?
---Mike
>Racoon users,
>
>This is the announcement that the kame project will quit providing
>a key management daemon, the racoon, and that "ipsec-tools" will become
>the formal team to release the racoon.
>The final release of the racoon in the
2009 Aug 03
1
[PATCH] Remove files imported via autogen.sh.
.../lib-prefix.m4: Likewise.
* m4/lock.m4: Likewise.
* m4/longdouble.m4: Likewise.
* m4/longlong.m4: Likewise.
* m4/nls.m4: Likewise.
* m4/po.m4: Likewise.
* m4/printf-posix.m4: Likewise.
* m4/progtest.m4: Likewise.
* m4/signed.m4: Likewise.
* m4/size_max.m4: Likewise.
* m4/stdint_h.m4: Likewise.
* m4/uintmax_t.m4: Likewise.
* m4/ulonglong.m4: Likewise.
* m4/visibility.m4: Likewise.
* m4/wchar_t.m4: Likewise.
* m4/wint_t.m4: Likewise.
* m4/xsize.m4: Likewise.
---
m4/.gitignore | 27 +++
m4/codeset.m4 | 23 ---
m4/gettext.m4 | 487 ----------------------------------------------
m4/glib...
2015 Feb 11
4
Samba 4.2.0rc4 fails to start up
...(ret == -1) {
ret = errno;
DEBUG(1, ("%s: fcntl failed: %s\n", __func__, strerror(ret)));
goto fail_close;
}
DEBUG(1, ("unique is %u\n", unique));
unique_len = snprintf(buf, sizeof(buf), "%ju\n", (uintmax_t)unique);
DEBUG(1, ("unique_len is: %i\n", unique_len));
/* shorten a potentially preexisting file */
ret = ftruncate(lockfile_fd, unique_len);
if (ret == -1) {
ret = errno;
DEBUG(1, ("%s: ftruncate failed: %s\n",...
2006 Mar 20
1
compilation and installation of dspam-plugin
...h:23,
from ../src/imap/common.h:4,
from spam_plugin.c:32:
/usr/include/stdint.h:111: error: conflicting types for `uint_fast32_t'
../src/lib/compat.h:46: error: previous declaration of `uint_fast32_t'
/usr/include/stdint.h:141: error: conflicting types for `uintmax_t'
../src/lib/compat.h:38: error: previous declaration of `uintmax_t'
In file included from ../src/lib/lib.h:23,
from ../src/imap/common.h:4,
from spam_plugin.c:32:
../src/lib/compat.h:107: error: redefinition of `struct iovec'
In file included from ../sr...
2013 Apr 01
0
Format warnings in krl.c
...39;) [-Wformat]
This comes from incorrectly assuming that u_int64_t is defined as
unsigned long long, whereas on 64-bit FreeBSD platforms, it is defined
as unsigned long. I don't know if gcc cares, but clang does.
The attached patch adds explicit casts to krl.c. I would prefer using
%ju and uintmax_t, but I'm doubt that uintmax_t is available on all
platforms OpenSSH supports.
DES
--
Dag-Erling Sm?rgrav - des at des.no
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openssh-krl-printf-format.diff
Type: text/x-patch
Size: 1660 bytes
Desc: not available...
2004 Aug 13
1
[PATCH] make spotless update
make spotless leaves 2 generated files.
diff -purN klibc-0.159.orig/klibc/Makefile klibc-0.159/klibc/Makefile
--- klibc-0.159.orig/klibc/Makefile 2004-08-03 23:07:05.000000000 +0200
+++ klibc-0.159/klibc/Makefile 2004-08-13 22:23:35.696699671 +0200
@@ -156,6 +156,7 @@ clean: archclean
rm -f sha1hash errlist.c
spotless: clean
+ rm -f include/klibc/havesyscall.h syscalls.nrs
find . \( -name
2015 Feb 10
1
Samba 4.2.0rc4 fails to start up
I am trying to see if Samba 4.2.0rc4 will run on a Solaris 10 i386 system.
After getting it to build, startup fails. Starting it up as
smbd -i -d 10
The output indicates that everything is starting normally until the
following is output:
messaging_dgm_lockfile_create: ftruncate failed: Invalid argument
messaging_dgm_init: messaging_dgm_create_lockfile failed: Invalid argument
messaging_dgm_init
2014 May 14
1
large integer values
Dear devels,
I need to create a (short) vector in C, which contains potentially very
large numbers, exponentially to the powers of 2.
This is my test example:
lgth = 35;
int power[lgth];
power[lgth - 1] = 1;
for (j = 1; j < lgth; j++) {
power[lgth - j - 1] = 2*power[lgth - j];
}
Everything works ok until it reaches the limit of 2^32:
power: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024,
2008 Feb 27
0
[LLVMdev] ABI for i128 on x86-32?
I think it's returned in 4 registers: eax, edx, esi, edi. Can someone
confirm?
Evan
On Feb 27, 2008, at 8:33 AM, gohman at apple.com wrote:
> Hello,
>
> Does anyone know of any precedent for handling i128 in the
> calling convention on x86-32? I'm trying to write a testcase
> that returns an i128 value, and LLVM currently has only two
> 32-bit GPRs designated for