Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
ef1e767a
Commit
ef1e767a
authored
May 27, 2013
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-4553 - Fixes for compilation under NetBSD.
parent
9bc4c418
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
5 deletions
+25
-5
include/my_global.h
include/my_global.h
+2
-0
include/my_pthread.h
include/my_pthread.h
+5
-1
sql/threadpool_unix.cc
sql/threadpool_unix.cc
+18
-4
No files found.
include/my_global.h
View file @
ef1e767a
...
@@ -1436,6 +1436,7 @@ static inline char *dlerror(void)
...
@@ -1436,6 +1436,7 @@ static inline char *dlerror(void)
#endif
#endif
/* Provide __func__ macro definition for platforms that miss it. */
/* Provide __func__ macro definition for platforms that miss it. */
#if !defined (__func__)
#if __STDC_VERSION__ < 199901L
#if __STDC_VERSION__ < 199901L
# if __GNUC__ >= 2
# if __GNUC__ >= 2
# define __func__ __FUNCTION__
# define __func__ __FUNCTION__
...
@@ -1453,6 +1454,7 @@ static inline char *dlerror(void)
...
@@ -1453,6 +1454,7 @@ static inline char *dlerror(void)
#else
#else
# define __func__ "<unknown>"
# define __func__ "<unknown>"
#endif
#endif
#endif
/* !defined(__func__) */
#ifndef HAVE_RINT
#ifndef HAVE_RINT
/**
/**
...
...
include/my_pthread.h
View file @
ef1e767a
...
@@ -119,7 +119,6 @@ int pthread_cancel(pthread_t thread);
...
@@ -119,7 +119,6 @@ int pthread_cancel(pthread_t thread);
#define HAVE_LOCALTIME_R 1
#define HAVE_LOCALTIME_R 1
#define _REENTRANT 1
#define _REENTRANT 1
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
#define PTHREAD_STACK_MIN 65536
#undef SAFE_MUTEX
/* This will cause conflicts */
#undef SAFE_MUTEX
/* This will cause conflicts */
#define pthread_key(T,V) DWORD V
#define pthread_key(T,V) DWORD V
...
@@ -857,6 +856,11 @@ extern uint thd_lib_detected;
...
@@ -857,6 +856,11 @@ extern uint thd_lib_detected;
#define mysql_mutex_record_order(A,B) do { } while(0)
#define mysql_mutex_record_order(A,B) do { } while(0)
#endif
#endif
/* At least Windows and NetBSD do not have this definition */
#ifndef PTHREAD_STACK_MIN
#define PTHREAD_STACK_MIN 65536
#endif
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
sql/threadpool_unix.cc
View file @
ef1e767a
...
@@ -286,6 +286,20 @@ static void *native_event_get_userdata(native_event *event)
...
@@ -286,6 +286,20 @@ static void *native_event_get_userdata(native_event *event)
}
}
#elif defined(HAVE_KQUEUE)
#elif defined(HAVE_KQUEUE)
/*
NetBSD is incompatible with other BSDs , last parameter in EV_SET macro
(udata, user data) needs to be intptr_t, whereas it needs to be void*
everywhere else.
*/
#ifdef __NetBSD__
#define MY_EV_SET(a, b, c, d, e, f, g) EV_SET(a, b, c, d, e, f, (intptr_t)g)
#else
#define MY_EV_SET(a, b, c, d, e, f, g) EV_SET(a, b, c, d, e, f, g)
#endif
int
io_poll_create
()
int
io_poll_create
()
{
{
return
kqueue
();
return
kqueue
();
...
@@ -294,7 +308,7 @@ int io_poll_create()
...
@@ -294,7 +308,7 @@ int io_poll_create()
int
io_poll_start_read
(
int
pollfd
,
int
fd
,
void
*
data
)
int
io_poll_start_read
(
int
pollfd
,
int
fd
,
void
*
data
)
{
{
struct
kevent
ke
;
struct
kevent
ke
;
EV_SET
(
&
ke
,
fd
,
EVFILT_READ
,
EV_ADD
|
EV_ONESHOT
,
MY_
EV_SET
(
&
ke
,
fd
,
EVFILT_READ
,
EV_ADD
|
EV_ONESHOT
,
0
,
0
,
data
);
0
,
0
,
data
);
return
kevent
(
pollfd
,
&
ke
,
1
,
0
,
0
,
0
);
return
kevent
(
pollfd
,
&
ke
,
1
,
0
,
0
,
0
);
}
}
...
@@ -303,7 +317,7 @@ int io_poll_start_read(int pollfd, int fd, void *data)
...
@@ -303,7 +317,7 @@ int io_poll_start_read(int pollfd, int fd, void *data)
int
io_poll_associate_fd
(
int
pollfd
,
int
fd
,
void
*
data
)
int
io_poll_associate_fd
(
int
pollfd
,
int
fd
,
void
*
data
)
{
{
struct
kevent
ke
;
struct
kevent
ke
;
EV_SET
(
&
ke
,
fd
,
EVFILT_READ
,
EV_ADD
|
EV_ONESHOT
,
MY_
EV_SET
(
&
ke
,
fd
,
EVFILT_READ
,
EV_ADD
|
EV_ONESHOT
,
0
,
0
,
data
);
0
,
0
,
data
);
return
io_poll_start_read
(
pollfd
,
fd
,
data
);
return
io_poll_start_read
(
pollfd
,
fd
,
data
);
}
}
...
@@ -312,7 +326,7 @@ int io_poll_associate_fd(int pollfd, int fd, void *data)
...
@@ -312,7 +326,7 @@ int io_poll_associate_fd(int pollfd, int fd, void *data)
int
io_poll_disassociate_fd
(
int
pollfd
,
int
fd
)
int
io_poll_disassociate_fd
(
int
pollfd
,
int
fd
)
{
{
struct
kevent
ke
;
struct
kevent
ke
;
EV_SET
(
&
ke
,
fd
,
EVFILT_READ
,
EV_DELETE
,
0
,
0
,
NULL
);
MY_EV_SET
(
&
ke
,
fd
,
EVFILT_READ
,
EV_DELETE
,
0
,
0
,
0
);
return
kevent
(
pollfd
,
&
ke
,
1
,
0
,
0
,
0
);
return
kevent
(
pollfd
,
&
ke
,
1
,
0
,
0
,
0
);
}
}
...
@@ -337,7 +351,7 @@ int io_poll_wait(int pollfd, struct kevent *events, int maxevents, int timeout_m
...
@@ -337,7 +351,7 @@ int io_poll_wait(int pollfd, struct kevent *events, int maxevents, int timeout_m
static
void
*
native_event_get_userdata
(
native_event
*
event
)
static
void
*
native_event_get_userdata
(
native_event
*
event
)
{
{
return
event
->
udata
;
return
(
void
*
)
event
->
udata
;
}
}
#elif defined (__sun)
#elif defined (__sun)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment