blob: 63ad579fdc455755a08ab65ede9428b4784bd849 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
using System;
using System.Runtime.InteropServices;
namespace Test {
public class Test {
[DllImport("libc")]
static extern int setenv(string name, string value, int overwrite);
[DllImport("libc")]
static extern string getenv(string name);
static int Main() {
string name = "mono_test";
string value = "val";
setenv (name, value, 1);
string ret = getenv (name);
if (ret != value)
return 1;
return 0;
}
}
}
|