search for: strncat

Displaying 20 results from an estimated 193 matches for "strncat".

Did you mean: strcat
2012 Aug 31
1
[PATCH V1] NEW API:ext:mke2fs
...amp; GUESTFS_MKE2FS_DISCARD_BITMASK) { + ADD_ARG (argv, i, "-E"); + if (discard) + ADD_ARG (argv, i, "discard"); + else + ADD_ARG (argv, i, "nodiscard"); + } + + if (optargs_bitmask & GUESTFS_MKE2FS_DIRINDEX_BITMASK) { + if (dirindex) + strncat (features, "dir_index", 9); + else + strncat (features, "^dir_index", 10); + feature++; + } + if (optargs_bitmask & GUESTFS_MKE2FS_EXTENT_BITMASK) { + if (feature == 0) { + if (extent) + strncat (features, "extent", 6); + else +...
2005 Jan 21
1
[PATCH] strncat appends not enough, doesnt terminate correctly
The klibc strncat doesnt behave like described in the man page. It doesnt terminate the string if size < strlen(src). It doesnt make dst longer than size. This breaks scsi_id from udev/extras #include <string.h> #include <stdio.h> int main(void) { unsigned char olh[42]; memset(olh, ...
2014 Sep 09
2
mutex
...85,19 @@ static ssize_t hwrng_attr_available_show(struct device *dev, ssize_t ret = 0; struct hwrng *rng; + buf[0] = '\0'; err = mutex_lock_interruptible(&rng_mutex); if (err) return -ERESTARTSYS; - buf[0] = '\0'; list_for_each_entry(rng, &rng_list, list) { strncat(buf, rng->name, PAGE_SIZE - ret - 1); ret += strlen(rng->name); strncat(buf, " ", PAGE_SIZE - ret - 1); ret++; } + mutex_unlock(&rng_mutex); strncat(buf, "\n", PAGE_SIZE - ret - 1); ret++; - mutex_unlock(&rng_mutex); return ret; }
2014 Sep 09
2
mutex
...85,19 @@ static ssize_t hwrng_attr_available_show(struct device *dev, ssize_t ret = 0; struct hwrng *rng; + buf[0] = '\0'; err = mutex_lock_interruptible(&rng_mutex); if (err) return -ERESTARTSYS; - buf[0] = '\0'; list_for_each_entry(rng, &rng_list, list) { strncat(buf, rng->name, PAGE_SIZE - ret - 1); ret += strlen(rng->name); strncat(buf, " ", PAGE_SIZE - ret - 1); ret++; } + mutex_unlock(&rng_mutex); strncat(buf, "\n", PAGE_SIZE - ret - 1); ret++; - mutex_unlock(&rng_mutex); return ret; }
2014 Sep 15
1
[PATCH v2 1/3] virtio-rng cleanup: move some code out of mutex protection
...struct device *dev, > ssize_t ret = 0; > struct hwrng *rng; > > + buf[0] = '\0'; > err = mutex_lock_interruptible(&rng_mutex); > if (err) > return -ERESTARTSYS; > - buf[0] = '\0'; > list_for_each_entry(rng, &rng_list, list) { > strncat(buf, rng->name, PAGE_SIZE - ret - 1); > ret += strlen(rng->name); > strncat(buf, " ", PAGE_SIZE - ret - 1); > ret++; > } > + mutex_unlock(&rng_mutex); > strncat(buf, "\n", PAGE_SIZE - ret - 1); > ret++; > - mutex_unlock(&rng_m...
2014 Sep 15
1
[PATCH v2 1/3] virtio-rng cleanup: move some code out of mutex protection
...struct device *dev, > ssize_t ret = 0; > struct hwrng *rng; > > + buf[0] = '\0'; > err = mutex_lock_interruptible(&rng_mutex); > if (err) > return -ERESTARTSYS; > - buf[0] = '\0'; > list_for_each_entry(rng, &rng_list, list) { > strncat(buf, rng->name, PAGE_SIZE - ret - 1); > ret += strlen(rng->name); > strncat(buf, " ", PAGE_SIZE - ret - 1); > ret++; > } > + mutex_unlock(&rng_mutex); > strncat(buf, "\n", PAGE_SIZE - ret - 1); > ret++; > - mutex_unlock(&rng_m...
2004 Sep 17
1
latest klibc for udev
This patch make it possible to run udev with the latest klibc. One patch for the udev/Makefile to match the moved include/ dir. Another one for klibc's string fuctions, that are causing segfaults: strncpy.c: the while() gets n == -1 and memset() dies strncat.c: cat's only strlen(dest) count of chars from src to dest Thanks, Kay -------------- next part -------------- ===== Makefile 1.169 vs edited ===== --- 1.169/Makefile 2004-09-14 07:55:07 +02:00 +++ edited/Makefile 2004-09-17 18:47:26 +02:00 @@ -140,7 +140,7 @@ ifeq ($(strip $(USE_KLIBC)),true...
2014 Sep 10
2
RFC virtio-rng: fail to read sysfs of a busy device
...t device *dev, > ssize_t ret = 0; > struct hwrng *rng; > > + buf[0] = '\0'; > err = mutex_lock_interruptible(&rng_mutex); > if (err) > return -ERESTARTSYS; > > - buf[0] = '\0'; > list_for_each_entry(rng, &rng_list, list) { > strncat(buf, rng->name, PAGE_SIZE - ret - 1); > ret += strlen(rng->name); > strncat(buf, " ", PAGE_SIZE - ret - 1); > ret++; > } > + mutex_unlock(&rng_mutex); > strncat(buf, "\n", PAGE_SIZE - ret - 1); > ret++; > - mutex_unlock(&rng_m...
2014 Sep 10
2
RFC virtio-rng: fail to read sysfs of a busy device
...t device *dev, > ssize_t ret = 0; > struct hwrng *rng; > > + buf[0] = '\0'; > err = mutex_lock_interruptible(&rng_mutex); > if (err) > return -ERESTARTSYS; > > - buf[0] = '\0'; > list_for_each_entry(rng, &rng_list, list) { > strncat(buf, rng->name, PAGE_SIZE - ret - 1); > ret += strlen(rng->name); > strncat(buf, " ", PAGE_SIZE - ret - 1); > ret++; > } > + mutex_unlock(&rng_mutex); > strncat(buf, "\n", PAGE_SIZE - ret - 1); > ret++; > - mutex_unlock(&rng_m...
2014 Sep 10
5
[PATCH 0/2] fix stuck in catting hwrng attributes
If we read hwrng by long-running dd process, it takes too much cpu time. When we check hwrng attributes from sysfs by cat, it gets stuck. The problem can only be reproduced with non-smp guest with slow backend. This patchset changed hwrng core to always delay 10 jiffies, cat process have chance to execute protected code, the problem is resolved. Thanks. Amos Kong (2): virtio-rng cleanup: move
2014 Sep 10
5
[PATCH 0/2] fix stuck in catting hwrng attributes
If we read hwrng by long-running dd process, it takes too much cpu time. When we check hwrng attributes from sysfs by cat, it gets stuck. The problem can only be reproduced with non-smp guest with slow backend. This patchset changed hwrng core to always delay 10 jiffies, cat process have chance to execute protected code, the problem is resolved. Thanks. Amos Kong (2): virtio-rng cleanup: move
2007 Apr 12
2
[PATCH] Make com32 printf obey width-restriction on %s
...++ syslinux-3.36/com32/lib/Makefile 2007-04-12 12:06:07.000000000 +0200 @@ -11,7 +11,7 @@ perror.o printf.o puts.o qsort.o realloc.o seed48.o snprintf.o \ sprintf.o srand48.o sscanf.o stack.o strcasecmp.o strcat.o \ strchr.o strcmp.o strcpy.o strdup.o strerror.o strlen.o \ - strncasecmp.o strncat.o strncmp.o strncpy.o strndup.o \ + strncasecmp.o strncat.o strncmp.o strncpy.o strndup.o strnlen.o \ strntoimax.o strntoumax.o strrchr.o strsep.o strspn.o strstr.o \ strtoimax.o strtok.o strtol.o strtoll.o strtoul.o strtoull.o \ strtoumax.o vfprintf.o vprintf.o vsnprintf.o vsprintf.o \...
2014 Sep 15
7
[PATCH v2 0/3] fix stuck in accessing hwrng attributes
If we read hwrng by long-running dd process, it takes too much cpu time and almost hold the mutex lock. When we check hwrng attributes from sysfs by cat, it gets stuck in waiting the lock releaseing. The problem can only be reproduced with non-smp guest with slow backend. This patchset resolves the issue by changing rng_dev_read() to always schedule 10 jiffies after release mutex lock, then cat
2014 Sep 15
7
[PATCH v2 0/3] fix stuck in accessing hwrng attributes
If we read hwrng by long-running dd process, it takes too much cpu time and almost hold the mutex lock. When we check hwrng attributes from sysfs by cat, it gets stuck in waiting the lock releaseing. The problem can only be reproduced with non-smp guest with slow backend. This patchset resolves the issue by changing rng_dev_read() to always schedule 10 jiffies after release mutex lock, then cat
2014 Sep 09
0
RFC virtio-rng: fail to read sysfs of a busy device
...85,19 @@ static ssize_t hwrng_attr_available_show(struct device *dev, ssize_t ret = 0; struct hwrng *rng; + buf[0] = '\0'; err = mutex_lock_interruptible(&rng_mutex); if (err) return -ERESTARTSYS; - buf[0] = '\0'; list_for_each_entry(rng, &rng_list, list) { strncat(buf, rng->name, PAGE_SIZE - ret - 1); ret += strlen(rng->name); strncat(buf, " ", PAGE_SIZE - ret - 1); ret++; } + mutex_unlock(&rng_mutex); strncat(buf, "\n", PAGE_SIZE - ret - 1); ret++; - mutex_unlock(&rng_mutex); return ret; } -- Amos.
2014 Sep 10
0
[PATCH 1/2] virtio-rng cleanup: move some code out of mutex protection
...84,19 @@ static ssize_t hwrng_attr_available_show(struct device *dev, ssize_t ret = 0; struct hwrng *rng; + buf[0] = '\0'; err = mutex_lock_interruptible(&rng_mutex); if (err) return -ERESTARTSYS; - buf[0] = '\0'; list_for_each_entry(rng, &rng_list, list) { strncat(buf, rng->name, PAGE_SIZE - ret - 1); ret += strlen(rng->name); strncat(buf, " ", PAGE_SIZE - ret - 1); ret++; } + mutex_unlock(&rng_mutex); strncat(buf, "\n", PAGE_SIZE - ret - 1); ret++; - mutex_unlock(&rng_mutex); return ret; } -- 1.9.3
2014 Sep 15
0
[PATCH v2 1/3] virtio-rng cleanup: move some code out of mutex protection
...84,19 @@ static ssize_t hwrng_attr_available_show(struct device *dev, ssize_t ret = 0; struct hwrng *rng; + buf[0] = '\0'; err = mutex_lock_interruptible(&rng_mutex); if (err) return -ERESTARTSYS; - buf[0] = '\0'; list_for_each_entry(rng, &rng_list, list) { strncat(buf, rng->name, PAGE_SIZE - ret - 1); ret += strlen(rng->name); strncat(buf, " ", PAGE_SIZE - ret - 1); ret++; } + mutex_unlock(&rng_mutex); strncat(buf, "\n", PAGE_SIZE - ret - 1); ret++; - mutex_unlock(&rng_mutex); return ret; } -- 1.9.3
2005 Apr 28
0
[LLVMdev] SimplifyLibCalls Pass -- Help!
..._offset_of_in(c,s) (if c is a constant integer and s is a constant string) * strrchr(s1,0) -> strchr(s1,0) strcmp: * strcmp(x,x) -> 0 * strcmp(x,"") -> *x * strcmp("",x) -> *x * strcmp(x,y) -> cnst (if both x and y are constant strings) strncat: * strncat(x,y,0) -> x * strncat(x,y,0) -> x (if strlen(y) = 0) * strncat(x,y,l) -> strcat(x,y) (if y and l are constants an l > strlen(y)) strncmp: * strncmp(x,y,0) -> 0 * strncmp(x,x,l) -> 0 * strncmp(x,"",l) -> *x * strncmp("",...
2020 Nov 02
0
[PATCH mlx5-next v1 03/11] net/mlx5_core: Clean driver version and name
...quot;); - > > MODULE_VERSION(DRIVER_VERSION); > > > > unsigned int mlx5_core_debug_mask; > > module_param_named(debug_mask, mlx5_core_debug_mask, uint, 0644); > > @@ -228,7 +227,7 @@ static void mlx5_set_driver_version(struct > > mlx5_core_dev *dev) > > strncat(string, ",", remaining_size); > > > > remaining_size = max_t(int, 0, driver_ver_sz - strlen(string)); > > - strncat(string, DRIVER_NAME, remaining_size); > > + strncat(string, KBUILD_MODNAME, remaining_size); > > > > remaining_size = max_t(int, 0, d...
2014 Sep 10
0
RFC virtio-rng: fail to read sysfs of a busy device
...struct hwrng *rng; > > > > + buf[0] = '\0'; > > err = mutex_lock_interruptible(&rng_mutex); > > if (err) > > return -ERESTARTSYS; > > > > - buf[0] = '\0'; > > list_for_each_entry(rng, &rng_list, list) { > > strncat(buf, rng->name, PAGE_SIZE - ret - 1); > > ret += strlen(rng->name); > > strncat(buf, " ", PAGE_SIZE - ret - 1); > > ret++; > > } > > + mutex_unlock(&rng_mutex); > > strncat(buf, "\n", PAGE_SIZE - ret - 1); > > re...