Permalink
Browse files

various compile fixes to work on MacOS X. Disable shm test for now.

  • Loading branch information...
1 parent 2a06767 commit 1618c9ed02af0d0034e6cc4be21d5930d311990a @avsm committed Oct 30, 2011
Showing with 24 additions and 26 deletions.
  1. +3 −3 Makefile
  2. +2 −1 pipe_lat.c
  3. +2 −2 pipe_thr.c
  4. +2 −1 shm.c
  5. +2 −2 tcp_lat.c
  6. +3 −4 tcp_local_lat.c
  7. +5 −8 tcp_remote_lat.c
  8. +1 −1 tcp_thr.c
  9. +2 −2 unix_lat.c
  10. +2 −2 unix_thr.c
View
6 Makefile
@@ -1,11 +1,11 @@
-CFLAGS = -g
+CFLAGS = -g -Wall
all: pipe_lat pipe_thr \
unix_lat unix_thr \
tcp_lat tcp_thr \
- tcp_local_lat tcp_remote_lat \
- shm
+ tcp_local_lat tcp_remote_lat
+# shm
shm: CFLAGS += -lrt
View
3 pipe_lat.c
@@ -27,10 +27,11 @@
*/
+#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
-#include <time.h>
+#include <sys/time.h>
#include <stdint.h>
View
4 pipe_thr.c
@@ -26,11 +26,11 @@
OTHER DEALINGS IN THE SOFTWARE.
*/
-
+#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
-#include <time.h>
+#include <sys/time.h>
#include <stdint.h>
View
3 shm.c
@@ -1,8 +1,9 @@
/* Measure latency of IPC using shm */
+#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
-#include <time.h>
+#include <sys/time.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/ipc.h>
View
4 tcp_lat.c
@@ -26,12 +26,12 @@
OTHER DEALINGS IN THE SOFTWARE.
*/
-
+#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <string.h>
-#include <time.h>
+#include <sys/time.h>
#include <stdint.h>
#include <netdb.h>
View
7 tcp_local_lat.c
@@ -26,12 +26,12 @@
OTHER DEALINGS IN THE SOFTWARE.
*/
-
+#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <string.h>
-#include <time.h>
+#include <sys/time.h>
#include <stdint.h>
#include <netdb.h>
@@ -40,8 +40,7 @@ int main(int argc, char *argv[])
{
int size;
char *buf;
- int64_t count, i, delta;
- struct timeval start, stop;
+ int64_t count, i;
ssize_t len;
size_t sofar;
View
13 tcp_remote_lat.c
@@ -26,12 +26,12 @@
OTHER DEALINGS IN THE SOFTWARE.
*/
-
+#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <string.h>
-#include <time.h>
+#include <sys/time.h>
#include <stdint.h>
#include <netdb.h>
@@ -46,13 +46,10 @@ int main(int argc, char *argv[])
ssize_t len;
size_t sofar;
- int yes = 1;
int ret;
- struct sockaddr_storage their_addr;
- socklen_t addr_size;
struct addrinfo hints;
struct addrinfo *res;
- int sockfd, new_fd;
+ int sockfd;
if (argc != 6) {
printf ("usage: tcp_lat <bind-to> <host> <port> <message-size> <roundtrip-count>\n");
@@ -100,7 +97,7 @@ int main(int argc, char *argv[])
exit(1);
}
- gettimeofday(&start);
+ gettimeofday(&start, NULL);
for (i = 0; i < count; i++) {
@@ -120,7 +117,7 @@ int main(int argc, char *argv[])
}
- gettimeofday(&stop);
+ gettimeofday(&stop, NULL);
delta = ((stop.tv_sec - start.tv_sec) * (int64_t) 1e6 +
stop.tv_usec - start.tv_usec);
View
2 tcp_thr.c
@@ -26,7 +26,7 @@
OTHER DEALINGS IN THE SOFTWARE.
*/
-
+#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
View
4 unix_lat.c
@@ -26,11 +26,11 @@
OTHER DEALINGS IN THE SOFTWARE.
*/
-
+#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
-#include <time.h>
+#include <sys/time.h>
#include <stdint.h>
View
4 unix_thr.c
@@ -26,11 +26,11 @@
OTHER DEALINGS IN THE SOFTWARE.
*/
-
+#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
-#include <time.h>
+#include <sys/time.h>
#include <stdint.h>

0 comments on commit 1618c9e

Please sign in to comment.