version 1.19, 2014/05/20 01:25:23 |
version 1.20, 2015/01/16 06:40:14 |
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
*/ |
*/ |
|
|
#include <sys/param.h> |
|
#include <sys/stat.h> |
#include <sys/stat.h> |
#include <sys/sysctl.h> |
#include <sys/sysctl.h> |
|
|
|
|
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
#include <unistd.h> |
#include <unistd.h> |
|
#include <limits.h> |
|
|
#define PROG_WHICH 1 |
#define PROG_WHICH 1 |
#define PROG_WHEREIS 2 |
#define PROG_WHEREIS 2 |
|
|
int |
int |
findprog(char *prog, char *path, int progmode, int allmatches) |
findprog(char *prog, char *path, int progmode, int allmatches) |
{ |
{ |
char *p, filename[MAXPATHLEN]; |
char *p, filename[PATH_MAX]; |
int proglen, plen, rval = 0; |
int proglen, plen, rval = 0; |
struct stat sbuf; |
struct stat sbuf; |
char *pathcpy; |
char *pathcpy; |