summaryrefslogtreecommitdiff
path: root/defs.h
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-08-31 12:07:38 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2011-08-31 12:07:38 +0200
commit5284557bfad96f12dd5798539008e1644f1dc094 (patch)
treee21f2606f12499b00031a2ce49e9b467cf3b287e /defs.h
parentb5b2589231847905229d78588316e708cbd03af1 (diff)
downloadstrace-5284557bfad96f12dd5798539008e1644f1dc094.tar.gz
strace-5284557bfad96f12dd5798539008e1644f1dc094.tar.bz2
strace-5284557bfad96f12dd5798539008e1644f1dc094.tar.xz
Optimization: eliminate some usages of strcat()
* defs.h: Declare stpcpy(). * util.c: Define stpcpy(). * file.c: Remove static str_append(). (sprint_open_modes): Use stpcpy() instead of str_append(). (sprintflags): Use stpcpy() instead of strcat(). (printpathn): Eliminate usage of strcat(). (printstr): Eliminate usage of strcat(). Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'defs.h')
-rw-r--r--defs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/defs.h b/defs.h
index 878cfdd..0b65257 100644
--- a/defs.h
+++ b/defs.h
@@ -680,6 +680,13 @@ extern void tv_sub(struct timeval *, struct timeval *, struct timeval *);
extern void tv_mul(struct timeval *, struct timeval *, int);
extern void tv_div(struct timeval *, struct timeval *, int);
+/* Some libc have stpcpy, some don't. Sigh...
+ * Roll our private implementation...
+ */
+#undef stpcpy
+#define stpcpy strace_stpcpy
+extern char *stpcpy(char *dst, const char *src);
+
#ifdef SUNOS4
extern int fixvfork(struct tcb *);
#endif