Skip to content

Commit 94c64fb

Browse files
Fix name collisions and some further problems
- F_LOCK is an integer constant, the original struct name is `struct flock` - sleep is `uint sleep(uint)` not `void sleep(int)` - ntFunction is really an "umbrella" typedef for several different function signatures, so just define it with ... now Signed-off-by: Fyodor Kovin <[email protected]>
1 parent c79e5a7 commit 94c64fb

File tree

8 files changed

+20
-17
lines changed

8 files changed

+20
-17
lines changed

c/bpxskt.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,17 @@ int setSocketTrace(int toWhat) {
129129
return was;
130130
}
131131

132-
void sleep(int seconds){
133-
int returnValue;
134-
int *returnValuePtr;
132+
unsigned int sleep(unsigned int seconds){
133+
unsigned int returnValue;
134+
unsigned int *returnValuePtr;
135135

136136
#ifndef _LP64
137-
returnValuePtr = (int*) (0x80000000 | ((int)&returnValue));
137+
returnValuePtr = (unsigned int*) (0x80000000 | ((int)&returnValue));
138138
#else
139139
returnValuePtr = &returnValue;
140140
#endif
141141
BPXSLP(seconds,returnValuePtr);
142+
return returnValue;
142143
}
143144

144145
void bpxSleep(int seconds)

c/crossmemory.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -3268,9 +3268,10 @@ static int handleModifyCommand(STCBase *base, CIB *cib, STCConsoleCommandType co
32683268
return 0;
32693269
}
32703270

3271-
static void sleep(int seconds){
3271+
static unsigned int sleep(unsigned int seconds){
32723272
int waitValue = seconds * 100;
32733273
__asm(" STIMER WAIT,BINTVL=%0\n" : : "m"(waitValue));
3274+
return 0;
32743275
}
32753276

32763277
static int isEnvironmentReady() {

c/mtlskt.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,10 @@
127127

128128
static int socketTrace = 0;
129129

130-
void sleep(int seconds){
130+
unsigned int sleep(unsigned int seconds){
131131
int waitValue = seconds * 100;
132132
__asm(" STIMER WAIT,BINTVL=%0\n" : : "m"(waitValue));
133+
return 0;
133134
}
134135

135136
void bpxSleep(int seconds)

c/zosfile.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -1642,14 +1642,14 @@ int fileSetLock(UnixFile *file, int *returnCode, int *reasonCode) {
16421642
#endif
16431643

16441644
int action = F_SET_LOCK;
1645-
F_LOCK flockdata;
1645+
BpxFLock flockdata;
16461646
flockdata.l_type = F_WRITE_LOCK;
16471647
flockdata.l_whence = F_SEEK_SET;
16481648
flockdata.l_start = 0;
16491649
flockdata.l_len = F_WHENCE_TO_END;
16501650
flockdata.l_pid = 0;
16511651

1652-
F_LOCK *fnctl_ptr = &flockdata;
1652+
BpxFLock *fnctl_ptr = &flockdata;
16531653

16541654
BPXFCT(&file->fd,
16551655
&action,
@@ -1677,14 +1677,14 @@ int fileGetLock(UnixFile *file, int *returnCode, int *reasonCode, int *isLocked)
16771677
#endif
16781678

16791679
int action = F_GET_LOCK;
1680-
F_LOCK flockdata;
1680+
BpxFLock flockdata;
16811681
flockdata.l_type = F_WRITE_LOCK;
16821682
flockdata.l_whence = F_SEEK_SET;
16831683
flockdata.l_start = 0;
16841684
flockdata.l_len = F_WHENCE_TO_END;
16851685
flockdata.l_pid = 0;
16861686

1687-
F_LOCK *fnctl_ptr = &flockdata;
1687+
BpxFLock *fnctl_ptr = &flockdata;
16881688

16891689
BPXFCT(&file->fd,
16901690
&action,
@@ -1716,14 +1716,14 @@ int fileUnlock(UnixFile *file, int *returnCode, int *reasonCode) {
17161716
#endif
17171717

17181718
int action = F_SET_LOCK;
1719-
F_LOCK flockdata;
1719+
BpxFLock flockdata;
17201720
flockdata.l_type = F_UNLOCK;
17211721
flockdata.l_whence = F_SEEK_SET;
17221722
flockdata.l_start = 0;
17231723
flockdata.l_len = F_WHENCE_TO_END;
17241724
flockdata.l_pid = 0;
17251725

1726-
F_LOCK *fnctl_ptr = &flockdata;
1726+
BpxFLock *fnctl_ptr = &flockdata;
17271727

17281728
BPXFCT(&file->fd,
17291729
&action,

h/bpxnet.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ typedef struct hostent_tag{
221221

222222
/* sleep(int seconds) is standard in linux */
223223
#if !defined(__ZOWE_OS_LINUX) && !defined(__ZOWE_OS_AIX)
224-
void sleep(int secs);
224+
unsigned int sleep(unsigned int);
225225
#endif
226226

227227
/* Set socket tracing; returns prior value */

h/dataservice.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121

2222

23-
typedef int ExternalAPI(void);
23+
typedef int ExternalAPI(struct DataService_tag *,struct HttpServer_tag *);
2424

2525
struct JsonObject_tag;
2626
struct HttpServer_tag;

h/metalio.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ typedef struct WPLFlags_tag{
119119
} WPLFlags;
120120

121121

122-
typedef int ntFunction(void);
122+
typedef int ntFunction(int *, ...);
123123

124124
#define NT_CREATE 1
125125
#define NT_RETRIEVE 2

h/unixfile.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -445,13 +445,13 @@ typedef struct F_CVT_tag {
445445
/* Length Values */
446446
#define F_WHENCE_TO_END 0 /* Locked file is from whence to end of the file */
447447

448-
typedef struct F_LOCK_TAG {
448+
typedef struct BpxFLock_Tag {
449449
short l_type;
450450
short l_whence;
451451
int64 l_start;
452452
int64 l_len;
453453
unsigned int l_pid;
454-
} F_LOCK;
454+
} BpxFLock;
455455

456456
int fileDisableConversion(UnixFile *file, int *returnCode, int *reasonCode);
457457
int fileSetLock(UnixFile *file, int *returnCode, int *reasonCode);

0 commit comments

Comments
 (0)