Question: Inspired by [this default for IO](http://meta.codegolf.stackexchange.com/a/5330/44713).

The Task
--------

Write a program that, given an input integer `x` between 0 and 255, crashes with exit code `x`.

Restrictions
------------

* You may not call anything which is intended directly for exit code output (`System.exit(x)`, returning from `main`, etc.). Instead, your program must cause an error or crash which will cause, with a probability of 1, the program to exit with the input integer.
	+ In this case, the words "error" and "crash" means that the program caused some fatal unintended exception, wherein a method, operation or otherwise was used incorrectly that caused an irreversible failure.
	+ You may not directly cause the error by throwing it directly. You must cause it by using a method, function, or otherwise whose purpose serves a different function (i.e. attempting to execute a file write to a read-only directory).
* You must have at least two exit codes accounted for in your program.
* Termination of the process with the use of signals is banned. (Reasoning may be found [in this discussion](http://chat.stackexchange.com/transcript/message/34843663#34843663))

Scoring
-------

Your program's score is determined by the number of supported exit codes, where code concision is tiebreaker. The greatest number of supported exit codes wins!

Answer: 
Perl, 108 bytes, 256 exit codes
===============================

This program (ab)uses [Test::More](http://search.cpan.org/~exodist/Test-Simple-1.302075/lib/Test/More.pm#EXIT_CODES) module. It tries to open file named `""` *n* times where *n* is given as command line argument. It fails every time, and each invocation is treated as a test. Test::More return number of failed tests as exit code. `plan tests => $ARGV[0]%255` is needed to get exit code 255.

```
#!/usr/bin/perl
use Test::More;
plan tests => $ARGV[0]%255 if($ARGV[0]>0);
ok(open(F,"")) for (1..$ARGV[0])

```
Python 2, 13 Bytes, 2 exit codes
================================

```
1/(input()-1)

```

If you enter 0, it tries to print `1/-1` which is -1 which is perfectly fine thus exit code 0. If you enter 1, you get `1/0` which raises a `ZeroDivisionError` in which there is an exit code of 1. With my IDE, there is only 0 and 1 for the exit codes...

Outputs:

---

[![enter image description here](https://i.stack.imgur.com/rdgXr.png)](https://i.stack.imgur.com/rdgXr.png)

---

[![enter image description here](https://i.stack.imgur.com/oK1ZY.png)](https://i.stack.imgur.com/oK1ZY.png)