Sponsored Content
Full Discussion: macintosh
Top Forums UNIX for Dummies Questions & Answers macintosh Post 302201573 by jamesapp on Monday 2nd of June 2008 01:13:10 PM
Old 06-02-2008
there was a c program which i got from this website. i pasted the program into a text editor. i then compiled the program, and it compiled without any errors. but when i went to run the program nothing seemed to happen. the program was supposed to scroll text slowly accross the screen. just wondering what i am doing wrong?
one question i have is the command to run the program, i tried the following:

Code:
./nodoff.out 500 filename

where filename is the name of a file in my current working directory. one thing i will mention is that i am running mac os x 10.5.2 leopard. i am using terminal and a gcc compiler. i don't know if the fact that i am running leopard should have an effect on the computer not being able to run the c program?
here is the source file of the program which i called nodoff.c:

Code:
#ifdef __STDC__
#define PROTOTYPICAL
#endif
#ifdef __cplusplus
#define PROTOTYPICAL
#endif

#include <stdlib.h>
#include <sys/time.h>

#ifdef PROTOTYPICAL
int main(int argc, char *argv[])
#else
main(argc,argv)
char *argv[];
#endif

{
        int millisecs, microsecs;
        struct timeval tv;

        millisecs=atoi(argv[1]);
        microsecs=millisecs*1000;

        tv.tv_sec=microsecs/1000000;
        tv.tv_usec=microsecs%1000000;

        select(0, NULL, NULL, NULL, &tv);
        exit(0);
}

any help would be appreciated.
 

7 More Discussions You Might Find Interesting

1. Where do I download LINUX & UNIX?

Unix for Macintosh

Hi all, I'm a Mac-user (imac se at the moment), using Mac OS 9.1 I really want to learn how to work with unix-systems. What is the best place for me to start? Where can i download a system? Can i still use my imac as a software basestation for an ibook running OS 9.1? It seems like i... (9 Replies)
Discussion started by: Icarus
9 Replies

2. Shell Programming and Scripting

Game spy arcade for halo and macintosh?

I need help i heard you can play halo over online and you have a macintosh version where can I get it please respond (1 Reply)
Discussion started by: memattmyself
1 Replies

3. UNIX for Advanced & Expert Users

Is Unix a Network operating system for Macintosh computers

I am in the process of reading up on and learning about linux,and as i read, i am seeing that it was built off of the unix system platform,and i also believe that it is used in the mac computer field,i would like to know if this is true, and if i should learn about the macintosh computer... (2 Replies)
Discussion started by: Bill1263
2 Replies

4. UNIX for Dummies Questions & Answers

Macintosh user needs help with pop3d

Hi folks! I am not a power user, and have been able to enable Postfix to run on my Macintosh. It was a little bit difficult for me. But I payed good attention, while following an Internet Tutorial. Postfix version 2.1.5 I can send out emails, from local accounts or even from other... (0 Replies)
Discussion started by: fundidor
0 Replies

5. UNIX for Dummies Questions & Answers

IP Address History for Macintosh

Hi all, I have been assigned the following task; I have a Macintosh iBook laptop computer running OSX (10.3). This computer was used to download some unwanted content from the Internet. We know by looking at the browser history that these downloads took place between May 1 and May 3. What... (0 Replies)
Discussion started by: olifer
0 Replies

6. Shell Programming and Scripting

UNIX in the MacIntosh (for sed people)

Hi, I'm trying to use sed to process some files on Macs running OSX. Anyone know anything about Macs and sed? Here's the problem sed 's/^/ /g' test_file > endfile (there are spaces betwen the second and third /, but the forum software compresses them) This should put spaces at... (3 Replies)
Discussion started by: Laurel Maury
3 Replies

7. OS X (Apple)

Macintosh Mount Clarification

Hi All, I am having a clarification regarding the mounted file systems on a normal mac. This is the output displayed once i launch terminal and key in mount command. ************************************************** /dev/disk0s2 on / (hfs, local, journaled) devfs on /dev (devfs, local,... (1 Reply)
Discussion started by: Achilles_Hectar
1 Replies
isaexec(3C)						   Standard C Library Functions 					       isaexec(3C)

NAME
isaexec - invoke isa-specific executable SYNOPSIS
#include <unistd.h> int isaexec(const char *path, char *const argv[], char *const envp[]); DESCRIPTION
The isaexec() function takes the path specified as path and breaks it into directory and file name components. It enquires from the running system the list of supported instruction set architectures; see isalist(5). The function traverses the list for an executable file in named subdirectories of the original directory. When such a file is located, execve() is invoked with argv[] and envp[]. See exec(2). RETURN VALUES
If no file is located, isaexec() returns ENOENT. Other return values are the same as for execve(). EXAMPLES
Example 1: Example of isaexec() function. On a system whose isalist is sparcv7 sparc the program int main(int argc, char *argv[], char *envp[]) { return (isaexec("/bin/thing", argv, envp)); } will look first for an executable file named /bin/sparcv7/thing, then for an executable file named /bin/sparc/thing. It will invoke execve() on the first executable file it finds named thing. On that same system, a program called /u/bin/tofu can cause either /u/bin/sparcv7/tofu or /u/bin/sparc/tofu to be invoked using the follow- ing code: int main(int argc, char *argv[], char *envp[]) { return (isaexec(getexecname(), argv, envp)); } ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ |Interface Stability |Stable | +-----------------------------+-----------------------------+ SEE ALSO
exec(2), getexecname(3C), attributes(5), isalist(5) SunOS 5.10 20 Mar 1998 isaexec(3C)
All times are GMT -4. The time now is 09:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy