@@ -62,7 +62,6 @@ void rm_queue(int);
key_t getipckey();
int getuserid(char *);
-int get_max_msgqueues(void);
int get_used_msgqueues(void);
#endif /* ipcmsg.h */
@@ -195,26 +195,3 @@ int get_used_msgqueues(void)
}
return used_queues;
}
-
-/*
- * Get the max number of message queues allowed on system
- */
-int get_max_msgqueues(void)
-{
- FILE *f;
- char buff[BUFSIZE];
-
- /* Get the max number of message queues allowed on system */
- f = fopen("/proc/sys/kernel/msgmni", "r");
- if (!f) {
- tst_resm(TBROK, "Could not open /proc/sys/kernel/msgmni");
- return -1;
- }
- if (!fgets(buff, BUFSIZE, f)) {
- fclose(f);
- tst_resm(TBROK, "Could not read /proc/sys/kernel/msgmni");
- return -1;
- }
- fclose(f);
- return atoi(buff);
-}
Only old msgstress cases use this api and we have used SAFE_FILE_SCANF("/proc/sys/kernel/msgmni", "%d", &nr_msgqs) to get the max msgqueues. So remove this uesless api. Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com> --- include/ipcmsg.h | 1 - libs/libltpipc/libipc.c | 23 ----------------------- 2 files changed, 24 deletions(-)