Re: [Mono-dev] Mono.Unix.Native

2015-01-11 Thread Greg Young
To answer my own question in case anyone runs into this. Try this: private byte* Align(IntPtr buf, uint alignTo) { //The buffer must originally be at least one alignment bigger! var diff = alignTo - (buf.ToInt64() % alignTo); var aligned = (IntP

Re: [Mono-dev] Mono.Unix.Native

2015-01-11 Thread Greg Young
Oops read is failing as well. Aside from having aligned buffer sizes do I need to do something like memalign? Cheers, Greg On Mon, Jan 12, 2015 at 3:55 AM, Greg Young wrote: > I have been trying to use Syscalls a bit but am getting an exception I > can't figure out why. > > Opening code throws

[Mono-dev] Mono.Unix.Native

2015-01-11 Thread Greg Young
I have been trying to use Syscalls a bit but am getting an exception I can't figure out why. Opening code throws no exceptions: var flags = OpenFlags.O_RDWR | OpenFlags.O_DIRECT | OpenFlags.O_CREAT; //var f = NativeConvert.FromOpenFlags(flags); not needed? var h

Re: [Mono-dev] CodeContacts open sourced

2015-01-11 Thread Greg Young
On Sunday, January 11, 2015, Michael Hutchinson wrote: > On 9 January 2015 at 16:32, Greg Young > wrote: > > It's not source analysis it theorem proving think formal proving a la > eiffel > > The Code Contracts tools analyze (and rewrite) compiled code, but > there's no reason why equivalent sou