1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Anestetic [448]
3 years ago
9

Before your shell forks a new process to call execvp(), it should parse the input string and separate it into a collection of su

bstrings representing the executable file and any command-line arguments. If the user entered an empty line, report an error and fetch a new line of input. Your code must handle at least four command-line arguments (in addition to the name of the executable file itself).
Computers and Technology
1 answer:
kompoz [17]3 years ago
3 0

Answer:

#define LSH_RL_BUFSIZE 1024

char *lsh_read_line(void)

{

int bufsize = LSH_RL_BUFSIZE;

int position = 0;

char buffer = malloc(sizeof(char) bufsize);

int c;

if (!buffer) {

   fprintf(stderr, "lsh: allocation error\n");

   exit(EXIT_FAILURE);

}

while (1) {

   // Read a character

   c = getchar();

   // If we hit EOF, replace it with a null character and return.

   if (c == EOF || c == '\n') {

     buffer[position] = '\0';

     return buffer;

   } else {

     buffer[position] = c;

   }

   position++;

   // If we have exceeded the buffer, reallocate.

   if (position >= bufsize) {

     bufsize += LSH_RL_BUFSIZE;

     buffer = realloc(buffer, bufsize);

     if (!buffer) {

       fprintf(stderr, "lsh: allocation error\n");

       exit(EXIT_FAILURE);

     }

   }

}

}

Explanation:

You might be interested in
Which of the following function declarations correctly expect an array as the first argument?
NARA [144]

Answer:

Only

Option: void f1(float array[], int size);

is valid.

Explanation:

To pass an array as argument in a function, the syntax should be as follows:

functionName (type arrayName[ ] )

We can't place the size of the array inside the array bracket (arrayName[100]) as this will give a syntax error. The empty bracket [] is required to tell the program that the value that passed as the argument is an array and differentiate it from other type of value.

3 0
3 years ago
Theodor is researching computer programming. He thinks that this career has a great employment outlook, so he’d like to learn if
Ronch [10]

The skills that are vital are:

  • Analytical skills to troubleshoot problems for clients.
  • The concentration and focus to be able to study and write computer code.

<h3>What are analytical and problem solving skills? </h3>

This is known to be the  ability of a person to be able to look into information in-depth so as to  tell the key or important elements, its strengths and weaknesses and others.

Therefore, The skills that are vital are:

  • Analytical skills to troubleshoot problems for clients.
  • The concentration and focus to be able to study and write computer code.

Learn more about Analytical skills from

brainly.com/question/2668962

#SPJ1

7 0
2 years ago
Using the arrow key you can adjust the position of a selection in increments of
nadezda [96]

Answer:

Ok

Explanation:

8 0
3 years ago
Pharming involves: setting up fake Wi-Fi access points that look as if they are legitimate public networks. redirecting users to
sweet-ann [11.9K]

Answer:

Explanation:

Pharming involves redirecting users to a fraudulent website even when the user has typed in the correct address in the web browser. An individual can accomplish this by changing the hosts file of the web address that the user is trying to access or by exploiting a DNS server error. Both of which will allow the individual to convince the victim that they are accessing the website that they were trying to access, but instead they have been redirected to a website that looks identical but is owned by the individual. The victim then enters their valuable and private information into the website and the individual can see it all and use it as they wish. Usually, this is done to steal banking information.

7 0
3 years ago
You learned that properly edited resumes are necessary for making a good impression on a university or a potential employer. Dis
beks73 [17]

Answer:

Resume is the important document for job seekers. As much as the resume is better, there is more chance to grab the job.

If the resume is poor, the employer may not call you for the interview.

Explanation:

Resume is the document that create and impression over the potential employer or university.

If someone have very good hard and soft skills, and does not mention all the skills in resume, then employer could not that skills that you may have. Because your resume is the document that represent you when you are not in front of the employer.  This is the first document, presented that, what  you are and how you are beneficial for the company.

<em>If your resume is poor it may cause that He cannot call you for the interview or not considered for that JOB.</em>

5 0
3 years ago
Read 2 more answers
Other questions:
  • Literacy is best defined as knowing how to: (Points : 1)
    7·2 answers
  • A web page typically contains ________, which contains the formatting instructions for displaying the web page.
    7·1 answer
  • Is it necessary that every autonomous system use the same intra-AS routing algorithm? Why or why not?
    10·1 answer
  • What type of network access control uses Active Directory to scan a device to verify that it is in compliance?
    11·1 answer
  • Precautionary measures to be observed when using ICT tools​
    15·1 answer
  • Describe how learning can be accessed in your class?​
    14·1 answer
  • Counselors do NOT provide which service during treatment?
    12·2 answers
  • Which factors are involved in search engine optimization​
    10·1 answer
  • Assignment 6: Animation
    7·1 answer
  • Which of the following parameters is optional sample(a,b,c,d=7
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!