Jerome Demantke
Jerome Demantke

Reputation: 335

How to set a timeout to an apache c module

I have an apache module written in C, and I would like to limit execution duration of this module to 15 minutes. Is it possible?

Upvotes: 0

Views: 34

Answers (1)

Enrico Migliore
Enrico Migliore

Reputation: 229

call the C function time() when module starts-up and store the time in a time_t variable.

Modify all the entry point functions of your C module in order to call time() and verify that are not elapsed 15*60 = 900 seconds.

Return -1 if 900 seconds are elapsed.

Upvotes: 0

Related Questions