summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/netperf/files
diff options
context:
space:
mode:
authorxin.ouyang@windriver.com <xin.ouyang@windriver.com>2012-11-12 09:39:46 +0000
committerJoe MacDonald <joe.macdonald@windriver.com>2012-11-19 11:18:30 -0500
commitb69b6e04f12b2fc45a3ebac8c741bda41fea6409 (patch)
treef91300ff9c5c6b506a20d1eb7a46633bf79c6fc1 /meta-networking/recipes-support/netperf/files
parent5955e22f6ecf0196a129c27641c6d85820f8b962 (diff)
downloadmeta-openembedded-b69b6e04f12b2fc45a3ebac8c741bda41fea6409.tar.gz
netperf: import from oe-classic and upgrade to 2.6.0
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
Diffstat (limited to 'meta-networking/recipes-support/netperf/files')
-rw-r--r--meta-networking/recipes-support/netperf/files/cpu_set.patch30
-rw-r--r--meta-networking/recipes-support/netperf/files/init62
-rw-r--r--meta-networking/recipes-support/netperf/files/vfork.patch58
3 files changed, 150 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/netperf/files/cpu_set.patch b/meta-networking/recipes-support/netperf/files/cpu_set.patch
new file mode 100644
index 000000000..434b79049
--- /dev/null
+++ b/meta-networking/recipes-support/netperf/files/cpu_set.patch
@@ -0,0 +1,30 @@
1Subject: [PATCH] netperf: fix CPU_SETSIZE to build with eglibc
2
3Upstream-Status: Pending
4
5Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
6---
7 src/netlib.c | 7 ++++++-
8 1 files changed, 6 insertions(+), 1 deletions(-)
9
10diff --git a/src/netlib.c b/src/netlib.c
11index 206e002..e33aae6 100644
12--- a/src/netlib.c
13+++ b/src/netlib.c
14@@ -2265,7 +2265,12 @@ bind_to_specific_processor(int processor_affinity, int use_cpu_map)
15 fall-back on what we had before, which is to use just the size of
16 an unsigned long. raj 2006-09-14 */
17
18-#if defined(__CPU_SETSIZE)
19+#if defined(CPU_SETSIZE)
20+#define NETPERF_CPU_SETSIZE CPU_SETSIZE
21+#define NETPERF_CPU_SET(cpu, cpusetp) CPU_SET(cpu, cpusetp)
22+#define NETPERF_CPU_ZERO(cpusetp) CPU_ZERO (cpusetp)
23+ typedef cpu_set_t netperf_cpu_set_t;
24+#elif defined(__CPU_SETSIZE)
25 #define NETPERF_CPU_SETSIZE __CPU_SETSIZE
26 #if defined(__CPU_SET_S)
27 #define NETPERF_CPU_SET(cpu, cpusetp) __CPU_SET_S(cpu, sizeof (cpu_set_t), cpusetp)
28--
291.7.1.1
30
diff --git a/meta-networking/recipes-support/netperf/files/init b/meta-networking/recipes-support/netperf/files/init
new file mode 100644
index 000000000..8ba2a6373
--- /dev/null
+++ b/meta-networking/recipes-support/netperf/files/init
@@ -0,0 +1,62 @@
1#!/bin/sh
2#
3#
4# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
5# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.org>.
6# Modified for Debian by Christoph Lameter <clameter@debian.org>
7# Modified for openembedded by Bruno Randolf <bruno.randolf@4g-systems.biz>
8
9### BEGIN INIT INFO
10# Provides: netperf
11# Required-Start: $remote_fs $local_fs $time
12# Required-Stop: $remote_fs $local_fs $time
13# Should-Start: $network $named
14# Should-Stop: $network $named
15# Default-Start: 2 3 4 5
16# Default-Stop: 0 1 6
17# Short-Description: network benchmark
18### END INIT INFO
19
20PATH=/bin:/usr/bin:/sbin:/usr/sbin
21DAEMON=/usr/sbin/netserver
22
23test -f $DAEMON || exit 0
24
25case "$1" in
26 start)
27 echo -n "Starting network benchmark server: netserver"
28 start-stop-daemon -S -x $DAEMON > /dev/null 2>&1
29 echo "."
30 ;;
31 stop)
32 echo -n "Stopping network benchmark server: netserver"
33 start-stop-daemon -K -x $DAEMON
34 echo "."
35 ;;
36 #reload)
37 #
38 # If the daemon can reload its config files on the fly
39 # for example by sending it SIGHUP, do it here.
40 #
41 # If the daemon responds to changes in its config file
42 # directly anyway, make this a do-nothing entry.
43 #
44 # start-stop-daemon --stop --signal 1 --verbose --exec $DAEMON
45 # ;;
46 restart|force-reload)
47 #
48 # If the "reload" option is implemented, move the "force-reload"
49 # option to the "reload" entry above. If not, "force-reload" is
50 # just the same as "restart".
51 #
52 start-stop-daemon -K -x $DAEMON
53 sleep 1
54 start-stop-daemon -S -x $DAEMON
55 ;;
56 *)
57 echo "Usage: /etc/init.d/netperf {start|stop|restart|force-reload}"
58 exit 1
59 ;;
60esac
61
62exit 0
diff --git a/meta-networking/recipes-support/netperf/files/vfork.patch b/meta-networking/recipes-support/netperf/files/vfork.patch
new file mode 100644
index 000000000..eff98bfde
--- /dev/null
+++ b/meta-networking/recipes-support/netperf/files/vfork.patch
@@ -0,0 +1,58 @@
1Subject: [PATCH] netperf: fix vfork/fork
2
3Upstream-Status: Pending
4
5Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
6---
7 src/netserver.c | 12 ++++++++++--
8 1 files changed, 10 insertions(+), 2 deletions(-)
9
10diff --git a/src/netserver.c b/src/netserver.c
11index 379a106..f6a8b09 100644
12--- a/src/netserver.c
13+++ b/src/netserver.c
14@@ -1020,7 +1020,7 @@ process_requests()
15 void
16 spawn_child() {
17
18-#if defined(HAVE_FORK)
19+#if defined(HAVE_FORK) || defined(HAVE_VFORK)
20
21 if (debug) {
22 fprintf(where,
23@@ -1038,7 +1038,11 @@ spawn_child() {
24
25 signal(SIGCLD,SIG_IGN);
26
27+#if defined(HAVE_FORK)
28 switch (fork()) {
29+#else
30+ switch (vfork()) {
31+#endif
32 case -1:
33 fprintf(where,
34 "%s: fork() error %s (errno %d)\n",
35@@ -1405,7 +1409,7 @@ scan_netserver_args(int argc, char *argv[]) {
36
37 void
38 daemonize() {
39-#if defined(HAVE_FORK)
40+#if defined(HAVE_FORK) || defined(HAVE_VFORK)
41
42 if (debug) {
43 fprintf(where,
44@@ -1419,7 +1423,11 @@ daemonize() {
45 fflush(stdout);
46 fflush(stderr);
47
48+#if defined(HAVE_FORK)
49 switch (fork()) {
50+#else
51+ switch (vfork()) {
52+#endif
53 case -1:
54 fprintf(stderr,
55 "%s: fork() error %s (errno %d)\n",
56--
571.7.1.1
58