Julian Seward 0356d27ca6 Merge in changes from the 2.4.0 line. This basically brings in the
overhaul of the thread support.  Many things are now probably broken,
but at least with --tool=none, simple and not-so-simple threaded and
non-thread programs work.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3265
2005-03-10 23:59:00 +00:00

30 lines
635 B
C

#include <sys/socket.h>
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
struct sockaddr name;
int res1, res2, res3;
int len = 10;
res1 = socket(PF_UNIX, SOCK_STREAM, 0);
if (res1 == 0) {
fprintf(stderr, "socket() failed\n");
exit(1);
}
/* Valgrind 1.0.X doesn't report the second error */
res2 = getsockname(res1, NULL, &len); /* NULL is bogus */
res3 = getsockname(res1, &name, NULL); /* NULL is bogus */
if (res2 == -1) {
fprintf(stderr, "getsockname(1) failed\n");
}
if (res3 == -1) {
fprintf(stderr, "getsockname(2) failed\n");
}
return 0;
}