Todd Wang | 644ec62 | 2015-04-06 17:46:44 -0700 | [diff] [blame] | 1 | // Copyright 2015 The Vanadium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | package exec |
| 6 | |
| 7 | // ExecVersionVariable is the name of the environment variable used by the exec |
| 8 | // package to communicate the protocol version between the parent and child. It |
| 9 | // takes care to clear this variable from the child process' environment as soon |
| 10 | // as it can, however, there may still be some situations where an application |
| 11 | // may need to test for its presence or ensure that it doesn't appear in a set |
| 12 | // of environment variables; exposing the name of this variable is intended to |
| 13 | // support such situations. |
| 14 | const ExecVersionVariable = "V23_EXEC_VERSION" |
Todd Wang | 3bb46f5 | 2015-05-14 22:01:18 -0700 | [diff] [blame] | 15 | |
| 16 | const ( |
| 17 | version1 = "1.0.0" |
| 18 | readyStatus = "ready::" |
| 19 | failedStatus = "failed::" |
| 20 | initStatus = "init" |
| 21 | |
| 22 | // eofChar is written onto the status pipe to signal end-of-file. It |
| 23 | // should be the last byte written onto the pipe, before closing it. |
| 24 | // This signals to the reader that no more input is coming. This is |
| 25 | // needed since we cannot use the closing of the write end of the pipe |
| 26 | // to send io.EOF to the reader: since there are two write ends (one in |
| 27 | // the parent and one in the child), closing any one of the two is not |
| 28 | // going to send io.EOF to the reader. |
| 29 | // Since the data coming from the child should be valid utf-8, we pick |
| 30 | // one of the invalid utf-8 bytes for this. |
| 31 | eofChar = 0xFF |
| 32 | ) |