tmpnam.c

来自「uClinux下用的数据库」· C语言 代码 · 共 22 行

C
22
字号
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>char *msql_tmpnam(baseName)        char *baseName;{    	static char buf[100];    	static int nr = 0;     	nr++;     	if (nr == 9999999)		nr = 1; 	sprintf(buf, "/tmp/%s.%07d.%07d", baseName ? baseName:"msql", nr,		(int)getpid());	return (char *)strdup(buf);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?