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
d96ada53
Commit
d96ada53
authored
May 11, 2004
by
tomas@mc05.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lots of HAVE_ and some ndb_global fixes for ndb subtree
parent
daff95f5
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
29 additions
and
83 deletions
+29
-83
ndb/include/ndb_net.h
ndb/include/ndb_net.h
+7
-0
ndb/include/portlib/NdbTCP.h
ndb/include/portlib/NdbTCP.h
+2
-10
ndb/include/portlib/NdbThread.h
ndb/include/portlib/NdbThread.h
+1
-2
ndb/src/common/portlib/unix/NdbCondition.c
ndb/src/common/portlib/unix/NdbCondition.c
+9
-40
ndb/src/common/portlib/unix/NdbMem.c
ndb/src/common/portlib/unix/NdbMem.c
+4
-4
ndb/src/common/portlib/unix/NdbSleep.c
ndb/src/common/portlib/unix/NdbSleep.c
+1
-11
ndb/src/common/portlib/unix/NdbThread.c
ndb/src/common/portlib/unix/NdbThread.c
+2
-3
ndb/src/common/portlib/unix/NdbTick.c
ndb/src/common/portlib/unix/NdbTick.c
+3
-7
ndb/src/kernel/vm/Emulator.cpp
ndb/src/kernel/vm/Emulator.cpp
+0
-6
No files found.
ndb/include/ndb_net.h
0 → 100644
View file @
d96ada53
#ifndef NDBNET_H
#define NDBNET_H
#include <my_net.h>
#endif
ndb/include/portlib/NdbTCP.h
View file @
d96ada53
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
#define NDB_TCP_H
#define NDB_TCP_H
#include <ndb_global.h>
#include <ndb_global.h>
#include <ndb_net.h>
#if defined NDB_OSE || defined NDB_SOFTOSE
#if defined NDB_OSE || defined NDB_SOFTOSE
/**
/**
...
@@ -45,10 +46,6 @@ typedef int socklen_t;
...
@@ -45,10 +46,6 @@ typedef int socklen_t;
/**
/**
* Include files needed
* Include files needed
*/
*/
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <netdb.h>
#define NDB_NONBLOCK O_NONBLOCK
#define NDB_NONBLOCK O_NONBLOCK
...
@@ -75,12 +72,7 @@ typedef int socklen_t;
...
@@ -75,12 +72,7 @@ typedef int socklen_t;
#endif
#endif
#ifndef NDB_MACOSX
#define NDB_SOCKLEN_T SOCKET_SIZE_TYPE
#define NDB_SOCKLEN_T socklen_t
#else
#define NDB_SOCKLEN_T int
#endif
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
...
...
ndb/include/portlib/NdbThread.h
View file @
d96ada53
...
@@ -17,8 +17,7 @@
...
@@ -17,8 +17,7 @@
#ifndef NDB_THREAD_H
#ifndef NDB_THREAD_H
#define NDB_THREAD_H
#define NDB_THREAD_H
#include <sys/types.h>
#include <ndb_global.h>
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
...
...
ndb/src/common/portlib/unix/NdbCondition.c
View file @
d96ada53
...
@@ -61,7 +61,6 @@ NdbCondition_Wait(struct NdbCondition* p_cond,
...
@@ -61,7 +61,6 @@ NdbCondition_Wait(struct NdbCondition* p_cond,
return
result
;
return
result
;
}
}
#if defined NDB_SOLARIS || defined NDB_HPUX
#include <time.h>
#include <time.h>
int
int
NdbCondition_WaitTimeout
(
struct
NdbCondition
*
p_cond
,
NdbCondition_WaitTimeout
(
struct
NdbCondition
*
p_cond
,
...
@@ -74,52 +73,24 @@ NdbCondition_WaitTimeout(struct NdbCondition* p_cond,
...
@@ -74,52 +73,24 @@ NdbCondition_WaitTimeout(struct NdbCondition* p_cond,
if
(
p_cond
==
NULL
||
p_mutex
==
NULL
)
if
(
p_cond
==
NULL
||
p_mutex
==
NULL
)
return
1
;
return
1
;
#ifdef HAVE_CLOCK_GETTIME
clock_gettime
(
CLOCK_REALTIME
,
&
abstime
);
clock_gettime
(
CLOCK_REALTIME
,
&
abstime
);
#else
if
(
msecs
>=
1000
){
{
secs
=
msecs
/
1000
;
msecs
=
msecs
%
1000
;
}
abstime
.
tv_sec
+=
secs
;
abstime
.
tv_nsec
+=
msecs
*
1000000
;
if
(
abstime
.
tv_nsec
>=
1000000000
)
{
abstime
.
tv_sec
+=
1
;
abstime
.
tv_nsec
-=
1000000000
;
}
result
=
pthread_cond_timedwait
(
&
p_cond
->
cond
,
p_mutex
,
&
abstime
);
return
result
;
}
#endif
#if defined NDB_LINUX || defined NDB_MACOSX
#include <unistd.h>
#include <sys/time.h>
int
NdbCondition_WaitTimeout
(
struct
NdbCondition
*
p_cond
,
NdbMutex
*
p_mutex
,
int
msecs
){
int
result
;
struct
timespec
abstime
;
struct
timeval
tick_time
;
struct
timeval
tick_time
;
int
secs
=
0
;
if
(
p_cond
==
NULL
||
p_mutex
==
NULL
)
return
1
;
gettimeofday
(
&
tick_time
,
0
);
gettimeofday
(
&
tick_time
,
0
);
abstime
.
tv_sec
=
tick_time
.
tv_sec
;
abstime
.
tv_nsec
=
tick_time
.
tv_usec
*
1000
;
}
#endif
if
(
msecs
>=
1000
){
if
(
msecs
>=
1000
){
secs
=
msecs
/
1000
;
secs
=
msecs
/
1000
;
msecs
=
msecs
%
1000
;
msecs
=
msecs
%
1000
;
}
}
abstime
.
tv_sec
+=
secs
;
abstime
.
tv_sec
=
tick_time
.
tv_sec
+
secs
;
abstime
.
tv_nsec
+=
msecs
*
1000000
;
abstime
.
tv_nsec
=
tick_time
.
tv_usec
*
1000
+
msecs
*
1000000
;
if
(
abstime
.
tv_nsec
>=
1000000000
)
{
if
(
abstime
.
tv_nsec
>=
1000000000
)
{
abstime
.
tv_sec
+=
1
;
abstime
.
tv_sec
+=
1
;
abstime
.
tv_nsec
-=
1000000000
;
abstime
.
tv_nsec
-=
1000000000
;
...
@@ -129,8 +100,6 @@ NdbCondition_WaitTimeout(struct NdbCondition* p_cond,
...
@@ -129,8 +100,6 @@ NdbCondition_WaitTimeout(struct NdbCondition* p_cond,
return
result
;
return
result
;
}
}
#endif
int
int
NdbCondition_Signal
(
struct
NdbCondition
*
p_cond
){
NdbCondition_Signal
(
struct
NdbCondition
*
p_cond
){
...
...
ndb/src/common/portlib/unix/NdbMem.c
View file @
d96ada53
...
@@ -54,16 +54,16 @@ void NdbMem_Free(void* ptr)
...
@@ -54,16 +54,16 @@ void NdbMem_Free(void* ptr)
int
NdbMem_MemLockAll
(){
int
NdbMem_MemLockAll
(){
#if
defined NDB_MACOSX
#if
def HAVE_MLOCKALL
return
0
;
return
-
1
;
#else
#else
return
mlockall
(
MCL_CURRENT
);
return
mlockall
(
MCL_CURRENT
);
#endif
#endif
}
}
int
NdbMem_MemUnlockAll
(){
int
NdbMem_MemUnlockAll
(){
#if
defined NDB_MACOSX
#if
def HAVE_MLOCKALL
return
0
;
return
-
1
;
#else
#else
return
munlockall
();
return
munlockall
();
#endif
#endif
...
...
ndb/src/common/portlib/unix/NdbSleep.c
View file @
d96ada53
...
@@ -15,19 +15,9 @@
...
@@ -15,19 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
#include "NdbSleep.h"
#include "NdbSleep.h"
#ifdef NDB_SOLARIS
#include <sys/types.h>
#include <unistd.h>
#endif
#if defined NDB_LINUX || defined NDB_HPUX || defined NDB_MACOSX
#include <time.h>
#include <unistd.h>
#endif
int
int
NdbSleep_MilliSleep
(
int
milliseconds
){
NdbSleep_MilliSleep
(
int
milliseconds
){
int
result
=
0
;
int
result
=
0
;
...
...
ndb/src/common/portlib/unix/NdbThread.c
View file @
d96ada53
...
@@ -16,9 +16,8 @@
...
@@ -16,9 +16,8 @@
#include <ndb_global.h>
#include <ndb_global.h>
#include <NdbThread.h>
#include "NdbThread.h"
#include <my_pthread.h>
#include <pthread.h>
#define MAX_THREAD_NAME 16
#define MAX_THREAD_NAME 16
...
...
ndb/src/common/portlib/unix/NdbTick.c
View file @
d96ada53
...
@@ -15,8 +15,8 @@
...
@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
#include "NdbTick.h"
#include "NdbTick.h"
#include <time.h>
#define NANOSEC_PER_SEC 1000000000
#define NANOSEC_PER_SEC 1000000000
#define MICROSEC_PER_SEC 1000000
#define MICROSEC_PER_SEC 1000000
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#define MILLISEC_PER_NANOSEC 1000000
#define MILLISEC_PER_NANOSEC 1000000
#if
defined NDB_SOLARIS || NDB_HPUX
#if
def HAVE_CLOCK_GETTIME
NDB_TICKS
NdbTick_CurrentMillisecond
(
void
)
NDB_TICKS
NdbTick_CurrentMillisecond
(
void
)
{
{
struct
timespec
tick_time
;
struct
timespec
tick_time
;
...
@@ -44,11 +44,7 @@ NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros){
...
@@ -44,11 +44,7 @@ NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros){
*
micros
=
t
.
tv_nsec
/
1000
;
*
micros
=
t
.
tv_nsec
/
1000
;
return
res
;
return
res
;
}
}
#endif
#else
#if defined NDB_LINUX || NDB_MACOSX
#include <unistd.h>
#include <sys/time.h>
NDB_TICKS
NdbTick_CurrentMillisecond
(
void
)
NDB_TICKS
NdbTick_CurrentMillisecond
(
void
)
{
{
struct
timeval
tick_time
;
struct
timeval
tick_time
;
...
...
ndb/src/kernel/vm/Emulator.cpp
View file @
d96ada53
...
@@ -39,12 +39,6 @@ extern "C" {
...
@@ -39,12 +39,6 @@ extern "C" {
extern
void
(
*
ndb_new_handler
)();
extern
void
(
*
ndb_new_handler
)();
}
}
#if defined (NDB_LINUX) || defined (NDB_SOLARIS)
#include <sys/types.h>
#include <sys/wait.h>
#endif
/**
/**
* Declare the global variables
* Declare the global variables
*/
*/
...
...
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