Does a directory /data/local exist on the filesystem and do your program have permissions to write to it?
On 15-May-2012, at 4:01 PM, NimeshChanchani wrote: > I'm getting an error on socket bind in android . i'm not doing this > through NDK , but cross compiling for android. I'm using AF_UNIX. code > snippet below. Any Idea? > > sockfd = socket(AF_UNIX, SOCK_STREAM, 0); > if (sockfd < 0) > { > printf("Error opening socket"); > return -1; > } > > bzero((char *) &server_addr, sizeof(server_addr)); > server_addr.sun_family = AF_UNIX; > strcpy(server_addr.sun_path, "/data/local/ipctest"); > unlink(server_addr.sun_path); > > if (bind(sockfd, (struct sockaddr *) &server_addr, > strlen(server_addr.sun_path) + sizeof(server_addr.sun_family)) < 0) > { > printf("Error on binding socket"); > return -1; > } > > -- > unsubscribe: android-porting+unsubscr...@googlegroups.com > website: http://groups.google.com/group/android-porting -- unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting