Bug #7174 | RFE: libmysql should mark sockets close-on-exec | ||
---|---|---|---|
Submitted: | 10 Dec 2004 16:44 | Modified: | 10 Dec 2004 19:10 |
Reporter: | [ name withheld ] | Email Updates: | |
Status: | Open | Impact on me: | |
Category: | MySQL Server: C API (client library) | Severity: | S4 (Feature request) |
Version: | 4.1.7 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[10 Dec 2004 16:44]
[ name withheld ]
[10 Dec 2004 19:10]
Sergei Golubchik
see also http://bugs.mysql.com/3779
[9 Sep 2014 11:34]
Juan Javier Baca
This flag should be configurable, so that fits any scenario. Also as mentioned in #3779 it shold be set by default. We really have to use this flag and we've solved this way: (works with libmysql16 and libmysql18): #include <fcntl.h> //Fake redefinition struct st_vio { my_socket sd; }; void mysql_set_close_on_exec(MYSQL *conn) { fcntl(conn->net.vio->sd, F_SETFD, FD_CLOEXEC); } Call mysql_set_close_on_exec(myConnection); Maybe someone can rely on this solution to solve their problems.