[MDEV-7473] [PATCH] Linux compile with cmake . -DHAVE_POLL=no fails to compile Created: 2015-01-16  Updated: 2022-11-20  Resolved: 2022-11-20

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.0.15
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Daniel Black Assignee: Sergei Golubchik
Resolution: Won't Fix Votes: 0
Labels: None
Environment:

linux x86_64


Attachments: File poll.patch    

 Description   

/home/dan/software_projects/mariadb-git/vio/viosocket.c: In function ‘vio_io_wait’:
/home/dan/software_projects/mariadb-git/vio/viosocket.c:923:17: error: storage size of ‘pfd’ isn’t known
   struct pollfd pfd;
                 ^
/home/dan/software_projects/mariadb-git/vio/viosocket.c:954:18: error: ‘POLLIN’ undeclared (first use in this function)
     pfd.events= MY_POLL_SET_IN;
                  ^
/home/dan/software_projects/mariadb-git/vio/viosocket.c:954:18: note: each undeclared identifier is reported only once for each function it appears in
/home/dan/software_projects/mariadb-git/vio/viosocket.c:954:27: error: ‘POLLPRI’ undeclared (first use in this function)
     pfd.events= MY_POLL_SET_IN;
                           ^
/home/dan/software_projects/mariadb-git/vio/viosocket.c:955:36: error: ‘POLLERR’ undeclared (first use in this function)
     revents= MY_POLL_SET_IN | MY_POLL_SET_ERR | POLLRDHUP;
                                    ^
/home/dan/software_projects/mariadb-git/vio/viosocket.c:955:46: error: ‘POLLHUP’ undeclared (first use in this function)
     revents= MY_POLL_SET_IN | MY_POLL_SET_ERR | POLLRDHUP;
                                              ^
/home/dan/software_projects/mariadb-git/vio/viosocket.c:955:56: error: ‘POLLNVAL’ undeclared (first use in this function)
     revents= MY_POLL_SET_IN | MY_POLL_SET_ERR | POLLRDHUP;
                                                        ^
/home/dan/software_projects/mariadb-git/vio/viosocket.c:959:18: error: ‘POLLOUT’ undeclared (first use in this function)
     pfd.events= MY_POLL_SET_OUT;
                  ^
/home/dan/software_projects/mariadb-git/vio/viosocket.c:969:3: warning: implicit declaration of function ‘poll’ [-Wimplicit-function-declaration]
   switch ((ret= poll(&pfd, 1, timeout)))
   ^
/home/dan/software_projects/mariadb-git/vio/viosocket.c:923:17: warning: unused variable ‘pfd’ [-Wunused-variable]
   struct pollfd pfd;
                 ^
make[2]: *** [vio/CMakeFiles/vio.dir/viosocket.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....



 Comments   
Comment by Daniel Black [ 2015-01-16 ]

in addition to the compile failure I found that mysqld will not return from the following mysqld.cc line even when a connection is made.

I verified that readFDs does contain the FD_ISSET(unixfd,readFDs).

retval= select((int) 0,&readFDs,0,0,0);

It seems that the first arguement is the number of fd. The 4th arguement is exceptions.
changing the code to:

retval= select(socket_count,&readFDs, 0, &readFDs, 0);

Did not change its locking behaviour. Only tested with unix sockets.

Comment by Sergei Golubchik [ 2022-11-20 ]

Is there a valid reason to build with -DHAVE_POLL=NO on Linux?

Generated at Thu Feb 08 07:19:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.