in reply to what is this doing? - while (wait() != -1)
------We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.